Skip to content

dart2js crashes when it finds "||=" operators (invalid) #31061

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

Closed
sigmundch opened this issue Oct 10, 2017 · 4 comments
Closed

dart2js crashes when it finds "||=" operators (invalid) #31061

sigmundch opened this issue Oct 10, 2017 · 4 comments
Assignees

Comments

@sigmundch
Copy link
Member

var x = false;
main() {
  x ||= true;
}

crashes dart2js with the following error:

The compiler crashed: NoSuchMethodError: The getter 'kind' was called on null.
Receiver: null
Tried calling: kind
#0      Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1      ResolverVisitor.handleUpdate (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/members.dart:3461:20)
#2      ResolverVisitor.handleStaticOrTopLevelUpdate (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/members.dart:2892:12)
#3      ResolverVisitor.handleResolvedSendSet (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/members.dart:2972:14)
#4      ResolverVisitor.handleUnqualifiedSendSet (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/members.dart:3032:14)
#5      ResolverVisitor.visitSendSet (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/members.dart:3519:14)
#6      SendSet.accept (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/tree/nodes.dart:824:38)
#7      CommonResolverVisitor.visit (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/resolution_common.dart:32:54)
#8      ResolverVisitor.visitExpressionStatement (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/members.dart:538:5)
#9      ExpressionStatement.accept (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/tree/nodes.dart:1695:38)
#10     CommonResolverVisitor.visit (file:///usr/local/google/home/sigmund/dart/git_all/sdk/pkg/compiler/lib/src/resolution/resolution_common.dart:32:54)
@sigmundch sigmundch self-assigned this Oct 10, 2017
@rakudrama
Copy link
Member

This feature appears to be untested on any platform.
The string ||= does not appear in the tests/ directory.

@eernstg
Copy link
Member

eernstg commented Oct 11, 2017

Issue #26998 already requests an implementation of the compound assignment operators ||= and &&= (but we need to make sure that it actually happens!).

I'll close this because it is subsumed by #26998.

@lrhn
Copy link
Member

lrhn commented Oct 11, 2017

While the feature isn't implemented yet, the compiler shouldn't be crashing on any syntax.

@lrhn lrhn reopened this Oct 11, 2017
@sigmundch
Copy link
Member Author

Correct - I filed the issue because a user run into this and found a crash. Fix added in https://dart-review.googlesource.com/c/sdk/+/12760

whesse pushed a commit that referenced this issue Oct 11, 2017
Bug: #31061
Change-Id: I3f8667d5dab92d256122484a6fc83b3527228085
Reviewed-on: https://dart-review.googlesource.com/12760
Reviewed-by: Johnni Winther <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants