Skip to content

DDC does not support map assignment operators with += in cascaded invocations #37286

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
corwinsheahan-wf opened this issue Jun 17, 2019 · 1 comment
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

Comments

@corwinsheahan-wf
Copy link

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:

  final map = {'key': 0}..['key'] += 3;

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:

[SEVERE] build_web_compilers:ddc on lib/entrypoint.dartdevc.module:
Error compiling dartdevc module:breaking|lib/entrypoint.ddc.js

We're sorry, you've found a bug in our compiler.
You can report this bug at:
    https://github.com/dart-lang/sdk/issues/labels/area-dev-compiler
Please include the information below in your report, along with
any other information that may help us track it down. Thanks!
    dartdevc arguments: --dart-sdk=/usr/local/Cellar/dart/2.3.0/libexec --dart-sdk-summary=/usr/local/Cellar/dart/2.3.0/libexec/lib/_internal/ddc_sdk.sum --modules=amd -o packages/breaking/entrypoint.ddc.js --module-root=. --library-root=/lib --summary-extension=dartdevc.linked.sum --no-summarize --options=packages/build_modules/src/analysis_options.default.yaml --source-map --source-map-comment --inline-source-map --url-mapping=package:breaking/entrypoint.dart,packages/breaking/entrypoint.dart --url-mapping=package:breaking/src/breaking.dart,packages/breaking/src/breaking.dart package:breaking/entrypoint.dart package:breaking/src/breaking.dart
    dart --version: 2.3.0 (Fri May 3 10:32:31 2019 +0200) on "macos_x64"

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)

@vsmenon
Copy link
Member

vsmenon commented Jun 17, 2019

FYI - marking this as won't fix as it's fixed in kernel-ddc.

@vsmenon vsmenon closed this as completed Jun 17, 2019
@vsmenon vsmenon added the closed-not-planned Closed as we don't intend to take action on the reported issue label Jun 17, 2019
This issue is being transferred. Timeline may not be complete until it finishes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants