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

add preliminary support for generic code #64

Merged
merged 1 commit into from
Jul 6, 2022
Merged

add preliminary support for generic code #64

merged 1 commit into from
Jul 6, 2022

Conversation

mvdan
Copy link
Owner

@mvdan mvdan commented Jun 29, 2022

(see commit message)

Fixes #62.

@mvdan
Copy link
Owner Author

mvdan commented Jun 29, 2022

cc @ainar-g @ldez

@mvdan
Copy link
Owner Author

mvdan commented Jun 29, 2022

Ah, the fix isn't actually complete, as there's also IndexExpr. Will send a second version.

@mvdan
Copy link
Owner Author

mvdan commented Jun 29, 2022

Reported the panics when running on std at golang/go#53604.

@mvdan
Copy link
Owner Author

mvdan commented Jun 29, 2022

Now with Go 1.17 support. The fix was indeed not trivial :)

Note that we don't yet support reporting unused parameters on generic
functions, as showed by the TODO in typeparams.txt, but at least we
don't panic as quickly as before.

Also note that running unparam on std currently panics as well,
presumably due to a bug in go/ssa that I will report shortly.

Thanks to Ainar Garipov for reporting and Ludovic Fernandez for
suggesting a fix.

Note that we need to use x/exp/typeparams to keep support for Go 1.17.x.

Fixes #62.
@mvdan mvdan merged commit 678bad1 into master Jul 6, 2022
@mvdan mvdan deleted the first-generics branch August 3, 2022 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: interface conversion: ast.Expr is *ast.IndexExpr, not *ast.Ident
1 participant