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

@@ -61,6 +61,7 @@ func init() {
// _go_constant_Value is an interface wrapper for Value type
type _go_constant_Value struct {
IValue interface{}
WExactString func() string
WKind func() constant.Kind
WString func() string