Skip to content

Invalid identifier crash in extension method on DDC #38542

@johnniwinther

Description

@johnniwinther

DDC currently crashes with invalid identifers on two co19 tests:

co19_2/LanguageFeatures/Extension-methods/extension_member_resolution_t01:

DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dartdevc --kernel --enable-experiment=extension-methods --ignore-unrecognized-flags --no-summarize --no-source-map -o /b/s/w/ir/out/ReleaseX64/generated_compilations/dartdevk-checked-sdk/tests_co19_2_src_LanguageFeatures_Extension-methods_extension_member_resolution_t01/extension_member_resolution_t01.js /b/s/w/ir/tests/co19_2/src/LanguageFeatures/Extension-methods/extension_member_resolution_t01.dart -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/async_helper.dill=async_helper -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/collection.dill=collection -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/expect.dill=expect -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/js.dill=js -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/matcher.dill=matcher -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/meta.dill=meta -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/path.dill=path -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/stack_trace.dill=stack_trace -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/unittest.dill=unittest (working directory: /b/s/w/ir/tests/co19_2/src/LanguageFeatures/Extension-methods)

exit code:
253

stdout:
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/web-dev-compiler
Please include the information below in your report, along with
any other information that may help us track it down. Thanks!
-------------------- %< --------------------
    dartdevc -k arguments: --enable-experiment=extension-methods --ignore-unrecognized-flags --no-summarize --no-source-map -o /b/s/w/ir/out/ReleaseX64/generated_compilations/dartdevk-checked-sdk/tests_co19_2_src_LanguageFeatures_Extension-methods_extension_member_resolution_t01/extension_member_resolution_t01.js /b/s/w/ir/tests/co19_2/src/LanguageFeatures/Extension-methods/extension_member_resolution_t01.dart -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/async_helper.dill=async_helper -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/collection.dill=collection -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/expect.dill=expect -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/js.dill=js -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/matcher.dill=matcher -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/meta.dill=meta -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/path.dill=path -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/stack_trace.dill=stack_trace -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/unittest.dill=unittest
    dart --version: 2.6.0-edge.175fc6edfff10cad2bc4465784a0752522c4580a (Tue Sep 24 07:55:45 2019 +0000) on "linux_x64"

Invalid argument (name): not a valid identifier: "_extension$0$+"
#0      new Identifier (package:dev_compiler/src/js_ast/nodes.dart:1383:7)
#1      new TemporaryId (package:dev_compiler/src/compiler/js_names.dart:37:30)
#2      ProgramCompiler._emitTemporaryId (package:dev_compiler/src/kernel/compiler.dart:511:14)
#3      ProgramCompiler._emitLibraryFunction (package:dev_compiler/src/kernel/compiler.dart:2459:41)
#4      MappedIterator.moveNext (dart:_internal/iterable.dart:393:18)
#5      new List.from (dart:core-patch/array_patch.dart:45:19)
#6      Iterable.toList (dart:core/iterable.dart:398:5)
#7      ProgramCompiler._emitLibraryProcedures (package:dev_compiler/src/kernel/compiler.dart:2418:10)
#8      ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:425:7)
#9      Iterable.forEach (dart:core/iterable.dart:277:30)
#10     ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:317:15)
#11     _compile (package:dev_compiler/src/kernel/command.dart:386:27)
#12     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#13     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#15     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#16     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#17     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#18     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#19     compile (package:front_end/src/api_unstable/ddc.dart)
#20     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#21     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#22     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#23     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#24     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#25     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

--- Re-run this test:
python tools/test.py -n dartdevk-checked-linux-release-chrome co19_2/LanguageFeatures/Extension-methods/extension_member_resolution_t01

co19_2/LanguageFeatures/Extension-methods/extension_member_resolution_t06:

DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dartdevc --kernel --enable-experiment=extension-methods --ignore-unrecognized-flags --no-summarize --no-source-map -o /b/s/w/ir/out/ReleaseX64/generated_compilations/dartdevk-checked-sdk/tests_co19_2_src_LanguageFeatures_Extension-methods_extension_member_resolution_t06/extension_member_resolution_t06.js /b/s/w/ir/tests/co19_2/src/LanguageFeatures/Extension-methods/extension_member_resolution_t06.dart -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/async_helper.dill=async_helper -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/collection.dill=collection -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/expect.dill=expect -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/js.dill=js -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/matcher.dill=matcher -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/meta.dill=meta -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/path.dill=path -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/stack_trace.dill=stack_trace -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/unittest.dill=unittest (working directory: /b/s/w/ir/tests/co19_2/src/LanguageFeatures/Extension-methods)

exit code:
253

stdout:
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/web-dev-compiler
Please include the information below in your report, along with
any other information that may help us track it down. Thanks!
-------------------- %< --------------------
    dartdevc -k arguments: --enable-experiment=extension-methods --ignore-unrecognized-flags --no-summarize --no-source-map -o /b/s/w/ir/out/ReleaseX64/generated_compilations/dartdevk-checked-sdk/tests_co19_2_src_LanguageFeatures_Extension-methods_extension_member_resolution_t06/extension_member_resolution_t06.js /b/s/w/ir/tests/co19_2/src/LanguageFeatures/Extension-methods/extension_member_resolution_t06.dart -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/async_helper.dill=async_helper -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/collection.dill=collection -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/expect.dill=expect -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/js.dill=js -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/matcher.dill=matcher -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/meta.dill=meta -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/path.dill=path -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/stack_trace.dill=stack_trace -s /b/s/w/ir/out/ReleaseX64/gen/utils/dartdevc/pkg_kernel/unittest.dill=unittest
    dart --version: 2.6.0-edge.175fc6edfff10cad2bc4465784a0752522c4580a (Tue Sep 24 07:55:45 2019 +0000) on "linux_x64"

Invalid argument (name): not a valid identifier: "E$+"
#0      new Identifier (package:dev_compiler/src/js_ast/nodes.dart:1383:7)
#1      new TemporaryId (package:dev_compiler/src/compiler/js_names.dart:37:30)
#2      ProgramCompiler._emitTemporaryId (package:dev_compiler/src/kernel/compiler.dart:511:14)
#3      ProgramCompiler._emitLibraryFunction (package:dev_compiler/src/kernel/compiler.dart:2459:41)
#4      MappedIterator.moveNext (dart:_internal/iterable.dart:393:18)
#5      new List.from (dart:core-patch/array_patch.dart:45:19)
#6      Iterable.toList (dart:core/iterable.dart:398:5)
#7      ProgramCompiler._emitLibraryProcedures (package:dev_compiler/src/kernel/compiler.dart:2418:10)
#8      ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:425:7)
#9      Iterable.forEach (dart:core/iterable.dart:277:30)
#10     ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:317:15)
#11     _compile (package:dev_compiler/src/kernel/command.dart:386:27)
#12     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#13     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#15     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#16     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#17     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#18     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#19     compile (package:front_end/src/api_unstable/ddc.dart)
#20     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#21     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#22     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#23     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#24     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#25     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

--- Re-run this test:
python tools/test.py -n dartdevk-checked-linux-release-chrome co19_2/LanguageFeatures/Extension-methods/extension_member_resolution_t06

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions