DDC does not support map assignment operators with +=
in cascaded invocations
#37286
Labels
closed-not-planned
Closed as we don't intend to take action on the reported issue
dev-compiler-errors
dev-compiler-fixed-with-kernel
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
web-dev-compiler
ATTN: This appears to be fixed in build_web_compilers 2.x. Sorry for any confusion. Feel free to close at your discretion.
Dart 2.3.0
build_web_compilers: 1.2.2
Hi there,
I was getting the generic
We're sorry, you've found a bug in our compiler
error message, and tracked it down to the source of the problem. Here is an example of the offending code, which breaks compilation only in ddc and not dart2js:The breaking part here seems to be the
+=
assignment in combination with the cascade. Either one separately does not break compilation. I checked out the dart-lang spec, and afaict this syntax should be supported.Here is the full error traceback:
NoSuchMethodError: The getter 'staticType' was called on null.
Receiver: null
Tried calling: staticType
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
#1 getStaticType (package:dev_compiler/src/analyzer/element_helpers.dart:117:7)
#2 CodeGenerator._bindValue (package:dev_compiler/src/analyzer/code_generator.dart:4994:36)
#3 CodeGenerator._bindLeftHandSide (package:dev_compiler/src/analyzer/code_generator.dart:4949:11)
#4 CodeGenerator._emitOpAssign (package:dev_compiler/src/analyzer/code_generator.dart:3415:15)
#5 CodeGenerator.visitAssignmentExpression (package:dev_compiler/src/analyzer/code_generator.dart:3388:12)
#6 AssignmentExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:748:49)
#7 CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5779:18)
#8 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#9 ListIterable.toList (dart:_internal/iterable.dart:219:19)
#10 CodeGenerator._visitExpressionList (package:dev_compiler/src/analyzer/code_generator.dart:5786:42)
#11 CodeGenerator.visitCascadeExpression (package:dev_compiler/src/analyzer/code_generator.dart:5113:20)
#12 CascadeExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:1279:49)
#13 CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5779:18)
#14 CodeGenerator.visitVariableDeclarationStatement (package:dev_compiler/src/analyzer/code_generator.dart:4231:19)
#15 VariableDeclarationStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:10529:15)
#16 CodeGenerator._visitStatement (package:dev_compiler/src/analyzer/code_generator.dart:5793:18)
#17 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#18 ListIterable.toList (dart:_internal/iterable.dart:219:19)
#19 CodeGenerator._visitStatementList (package:dev_compiler/src/analyzer/code_generator.dart:5800:41)
#20 CodeGenerator.visitBlockFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:3601:21)
#21 BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1072:49)
#22 CodeGenerator._emitFunctionScopedBody (package:dev_compiler/src/analyzer/code_generator.dart:2824:22)
#23 CodeGenerator._emitSyncFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:2773:17)
#24 CodeGenerator._emitFunction (package:dev_compiler/src/analyzer/code_generator.dart:2756:11)
#25 CodeGenerator._emitMethodDeclaration (package:dev_compiler/src/analyzer/code_generator.dart:2552:12)
#26 CodeGenerator._emitClassMethods (package:dev_compiler/src/analyzer/code_generator.dart:1464:23)
#27 CodeGenerator._emitClassDeclaration (package:dev_compiler/src/analyzer/code_generator.dart:810:21)
#28 CodeGenerator.visitClassDeclaration (package:dev_compiler/src/analyzer/code_generator.dart:769:12)
#29 ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1560:49)
#30 CodeGenerator._emitTypeDeclaration (package:dev_compiler/src/analyzer/code_generator.dart:502:26)
#31 CodeGenerator.visitCompilationUnit (package:dev_compiler/src/analyzer/code_generator.dart:556:9)
#32 List.forEach (dart:core-patch/array.dart:106:8)
#33 CodeGenerator.compile (package:dev_compiler/src/analyzer/code_generator.dart:313:22)
#34 compileWithAnalyzer (package:dev_compiler/src/analyzer/module_compiler.dart:108:33)
#35 _compile (package:dev_compiler/src/analyzer/command.dart:152:16)
#36 compile (package:dev_compiler/src/analyzer/command.dart:56:18)
#37 compile (package:dev_compiler/src/compiler/shared_command.dart:405:18)
#38 _CompilerWorker.performRequest. (file:///b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/bin/dartdevc.dart:54:39)
#39 _rootRun (dart:async/zone.dart:1124:13)
#40 _CustomZone.run (dart:async/zone.dart:1021:19)
#41 _runZoned (dart:async/zone.dart:1516:10)
#42 runZoned (dart:async/zone.dart:1463:12)
#43 _CompilerWorker.performRequest (file:///b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/bin/dartdevc.dart:54:24)
#44 AsyncWorkerLoop.run. (package:bazel_worker/src/worker/async_worker_loop.dart:33:41)
#45 _rootRun (dart:async/zone.dart:1124:13)
#46 _CustomZone.run (dart:async/zone.dart:1021:19)
#47 _runZoned (dart:async/zone.dart:1516:10)
#48 runZoned (dart:async/zone.dart:1463:12)
#49 AsyncWorkerLoop.run (package:bazel_worker/src/worker/async_worker_loop.dart:33:26)
#50 main (file:///b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/bin/dartdevc.dart:28:57)
#51 _startIsolate. (dart:isolate-patch/isolate_patch.dart:296:32)
#52 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
The text was updated successfully, but these errors were encountered: