diff --git a/_test/alias1.go b/_test/alias1.go new file mode 100644 index 000000000..83f134263 --- /dev/null +++ b/_test/alias1.go @@ -0,0 +1,16 @@ +package main + +import "fmt" + +type MyT T + +type T struct { + Name string +} + +func main() { + fmt.Println(MyT{}) +} + +// Output: +// {} diff --git a/interp/gta.go b/interp/gta.go index aa75a4da8..8d3b5b251 100644 --- a/interp/gta.go +++ b/interp/gta.go @@ -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