Closed
Description
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)
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
rakudrama commentedon Oct 10, 2017
This feature appears to be untested on any platform.
The string
||=
does not appear in the tests/ directory.eernstg commentedon 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 commentedon Oct 11, 2017
While the feature isn't implemented yet, the compiler shouldn't be crashing on any syntax.
sigmundch commentedon Oct 11, 2017
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
fix recovery on ||= and &&= in dart2js