-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interface assertion not work #1558
Comments
the address of empty struct value is 0, so we cannot get the implementation. another field IType to store Type is nesserary. or the type of IValue should be |
another case:
if define the interface in src package, it can compare every method (in |
and
is not working too, even if interface is in the same src package, i found that yaegi/interp/run.go:2997:
dest value can also be a interface too, so we should compare all its method. |
Embedding files using `//go:embed` and `embed` packages can not be supported in yaegi, so it is better to not generate the wrapper to embed and have a graceful error in case of usage of `embed.FS` in the interpreter. Also update README about unsuported directives. Fixes #1558.
The commit 25f44d6 seem like had a wrong issue referenced. |
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
v0.15.1
Additional Notes
hi,
assertion from a interface to another interface is not working.
I haven't found the exact location in the source code where this bug occurs yet, but I can suggest some possible causes and solutions for the bug:
output:
I think when trying to know whether
v.CanConvert()
, we shouldElem
the v ifv.Kind == reflect.Interface
.The text was updated successfully, but these errors were encountered: