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
Labeled local function declaration crashes dart2js #19633
Comments
The compiler crashed: type 'LocalFunctionElementX' is not a subtype of type 'TargetElement' of 'function result'. Removed Priority-Unassigned label. |
Maybe we should instead change the spec so localVariableDeclaration and localFunctionDeclaration are not unlabledStatement, but are instead productions directly on the statement non-terminal. They are really declarations, not statements. cc @gbracha. |
I suppose we could do that, but: a. Local var decls include executable code, and so are just as much statements as anything else. b. Changing the spec impacts the VM as well. The approach of changing the spec when an implementation has a bug is not really attractive. |
The language should definitely not be changed just to avoid us fixing a bug. Lasse's suggestion might make sense on its own, though. (But you, Gilad, seem to disagree). Removed Priority-Low label. |
this appears to be working now. |
Example code:
main() {
foo: int bar() => 42;
}
crashes dart2js.
The spec allows labels in front of local variable and function declarations.
The text was updated successfully, but these errors were encountered: