dart-archive / sdk

The Dartino project was an experiment seeking to improve productivity when writing application code for embedded devices.
https://dartino.org
Other
332 stars 36 forks source link

Compiler error when accessing elements in a list literal #549

Closed jakobr-google closed 8 years ago

jakobr-google commented 8 years ago

Sample code:

main() { var list = [1, 2, 3]; list[0]; }

Produces the following error during compilation:

lib/system/list.dart:20:11: Internal Error: The compiler crashed when compiling this element. @native E operator[](int index) { ^^^^^^^^^^^^^^^^^^^^^^^ The Dartino compiler is broken.

When compiling the above element, the compiler crashed. It is not possible to tell if this is caused by a problem in your program or not. Regardless, the compiler should not crash.

The Dartino team would greatly appreciate if you would take a moment to report this problem at https://github.com/dartino/sdk/issues/new

Please include the following information:

Unsupported native function: FixedListBase.[]

0 DartinoBackend.codegenNativeFunction (package:dartino_compiler/src/dartino_backend.dart:1049:7)

1 DartinoBackend.codegenFunction (package:dartino_compiler/src/dartino_backend.dart:986:7)

2 DartinoBackend.compileElement. (package:dartino_compiler/src/dartino_backend.dart:793:9)

3 CompilerDiagnosticReporter.withCurrentElement (package:compiler/src/compiler.dart:1555:15)

4 DartinoBackend.compileElement (package:dartino_compiler/src/dartino_backend.dart:782:23)

5 DartinoEnqueuer.processQueue (package:dartino_compiler/src/dartino_enqueuer.dart:211:40)

6 DartinoEnqueuer.forEach (package:dartino_compiler/src/dartino_enqueuer.dart:188:5)

7 Compiler.emptyQueue. (package:compiler/src/compiler.dart:945:15)

8 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:171:35)

9 Compiler.emptyQueue (package:compiler/src/compiler.dart:944:16)

10 Compiler.processQueue. (package:compiler/src/compiler.dart:981:9)

11 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:171:35)

12 Compiler.processQueue (package:compiler/src/compiler.dart:958:16)

13 Compiler.compileLoadedLibraries. (package:compiler/src/compiler.dart:894:9)

14 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:171:35)

15 Compiler.compileLoadedLibraries (package:compiler/src/compiler.dart:797:16)

16 DartinoCompilerImplementation.compileLoadedLibraries (package:dartino_compiler/src/dartino_compiler_implementation.dart:236:33)

17 Compiler.runInternal. (package:compiler/src/compiler.dart:707:7)

18 _rootRunUnary (dart:async/zone.dart:902)

19 _CustomZone.runUnary (dart:async/zone.dart:798)

20 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:551)

21 _Future._propagateToListeners (dart:async/future_impl.dart:637)

22 _Future._completeWithValue (dart:async/future_impl.dart:424)

23 _Future._asyncComplete. (dart:async/future_impl.dart:479)

24 _rootRun (dart:async/zone.dart:895)

25 _CustomZone.run (dart:async/zone.dart:790)

26 _CustomZone.bindCallback. (dart:async/zone.dart:723)

27 _microtaskLoop (dart:async/schedule_microtask.dart:41)

28 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)

29 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

30 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

jakobr-google commented 8 years ago

Never mind - this was changed recently, and I hadn't rebuilt the VM.