interp: add support of interface wrappers to type assertions

Store the interpreter value of the interface object to wrap as
a field called IValue, at offset 0 in wrapper structures.

Update extract to include IValue field.

In typeAssert, detect interface wrapper, and dereference the
interpreter value from IValue wrapper field.

Fixes #1166.
This commit is contained in:
Marc Vertes
2021-07-12 17:10:13 +02:00
committed by GitHub
parent 78d7e85352
commit fc970799a1
183 changed files with 707 additions and 80 deletions

View File

@@ -1176,6 +1176,9 @@ func (t *itype) id() (res string) {
case variadicT:
res = "..." + t.val.id()
}
if res == "" {
res = t.TypeOf().String()
}
return res
}