Open tttoad opened 1 year ago
Maybe we can modify the output file like this:
type _go_types_Object struct {
IValue interface{}
}
func (W _go_types_Object) Exported() bool {
return W.IValue.(types.Object).Exported()
}
func (W _go_types_Object) Id() string {
return W.IValue.(types.Object).Id()
}
func (W _go_types_Object) Name() string {
return W.IValue.(types.Object).Name()
}
func (W _go_types_Object) Parent() *types.Scope {
return W.IValue.(types.Object).Parent()
}
func (W _go_types_Object) Pkg() *types.Package {
return W.IValue.(types.Object).Pkg()
}
func (W _go_types_Object) Pos() token.Pos {
return W.IValue.(types.Object).Pos()
}
func (W _go_types_Object) String() string {
return W.IValue.(types.Object).String()
}
func (W _go_types_Object) Type() types.Type {
return W.IValue.(types.Object).Type()
}
@mvertes What do you think?
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
0.15.0
Additional Notes
// _go_types_Object is an interface wrapper for Object type type _go_types_Object struct { IValue interface{} WExported func() bool WId func() string WName func() string WParent func() types.Scope WPkg func() types.Package WPos func() token.Pos WString func() string WType func() types.Type }
The key of a map cannot contain the
func
field.