fix: handle forward declaration of alias type
This commit is contained in:
committed by
Traefiker Bot
parent
8a88a1ab8a
commit
effd64c980
16
_test/alias1.go
Normal file
16
_test/alias1.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type MyT T
|
||||
|
||||
type T struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println(MyT{})
|
||||
}
|
||||
|
||||
// Output:
|
||||
// {}
|
||||
@@ -165,7 +165,7 @@ func (interp *Interpreter) gta(root *node, rpath string) ([]*node, error) {
|
||||
return false
|
||||
}
|
||||
if n.child[1].kind == identExpr {
|
||||
n.typ = &itype{cat: aliasT, val: typ, name: typeName, path: rpath}
|
||||
n.typ = &itype{cat: aliasT, val: typ, name: typeName, path: rpath, incomplete: typ.incomplete}
|
||||
} else {
|
||||
n.typ = typ
|
||||
n.typ.name = typeName
|
||||
|
||||
Reference in New Issue
Block a user