-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: cannot export = (21) node #44325
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
Comments
Here's a related example that produces a different compiler error:
From the above code I get this error:
|
/cc @danscales This seems related to exporting closures. |
Yes, thanks, I will take a look. |
I have a similar issue but no simple reproducer available. I was able to
|
@tonyghita That commit is included in Go 1.16. I think that's separate from this issue or #44335, which are about failures that appeared post 1.16. It would be great if you would file a new issue and provide steps to reproduce it. Thanks. |
From the stack trace, it looks like the issue is that iexport is finding an |
This is right, e.g, if we change
or:
Then it compiles ok. |
Change https://golang.org/cl/293669 mentions this issue: |
There are two different bugs here, and I have a fix for both, I believe. The export = (21) bug is because the check to avoid creating a new closure function in tcClosure is not quite right. Unfortunately, tcClosure has the side effect of creating a new closure function, but we don't want to do that when we are type-checking a function inline body. @cuonglm I would say your change is dealing with symptoms, but not with the problem. The second bug (rogpeppe's second example) relates to how we are importing/exporting closure vars when they are referencing variables across multiple closures. I will re-open #44335 as a representative of that bug (Value live at entry) |
Change https://golang.org/cl/294211 mentions this issue: |
commit 2f0da6d
The following testscript example gives gives me an internal compiler error:
The error I see is:
The text was updated successfully, but these errors were encountered: