fix: correct handling of interface types in composite literals

This commit is contained in:
Marc Vertes
2020-04-16 19:54:03 +02:00
committed by GitHub
parent 29e1777d82
commit c580dfdbc8
7 changed files with 88 additions and 13 deletions

View File

@@ -844,7 +844,7 @@ func (t *itype) zero() (v reflect.Value, err error) {
v, err = t.val.zero()
case arrayT, ptrT, structT:
v = reflect.New(t.TypeOf()).Elem()
v = reflect.New(t.frameType()).Elem()
case valueT:
v = reflect.New(t.rtype).Elem()
@@ -1002,7 +1002,7 @@ func exportName(s string) string {
return "X" + s
}
var interf = reflect.TypeOf(new(interface{})).Elem()
var interf = reflect.TypeOf((*interface{})(nil)).Elem()
// RefType returns a reflect.Type representation from an interpereter type.
// In simple cases, reflect types are directly mapped from the interpreter