Skip to content
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

Issue with non-exported method interface definition with binary mode #1373

Closed
cclerget opened this issue Apr 6, 2022 · 2 comments · Fixed by #1374
Closed

Issue with non-exported method interface definition with binary mode #1373

cclerget opened this issue Apr 6, 2022 · 2 comments · Fixed by #1374
Labels
area/core bug Something isn't working
Milestone

Comments

@cclerget
Copy link
Contributor

cclerget commented Apr 6, 2022

The following program sample.go triggers an unexpected result

package main

import (
	"fmt"
	"go/ast"
)

func NewBadExpr() ast.Expr {
	return &ast.BadExpr{}
}

func main() {
	fmt.Printf("%T\n", NewBadExpr().(*ast.BadExpr))
}

Expected result

$ go run ./sample.go
*ast.BadExpr

Got

$ yaegi ./sample.go
impossible type assertion: *ast.BadExpr does not implement ast.Expr (missing exprNode method)

Yaegi Version

v0.11.2

Additional Notes

@mvertes
Copy link
Member

mvertes commented Apr 7, 2022

I tried to reproduce this issue on v0.11.2 and on HEAD of master, and could not, obtaining always the expected result. Are you sure of this ?

@cclerget
Copy link
Contributor Author

cclerget commented Apr 7, 2022

Yes, I just updated the reproducer based on #1374

@mvertes mvertes added bug Something isn't working area/core labels Apr 7, 2022
@mvertes mvertes added this to the v0.11.x milestone Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants