Hint for const #18413
Labels
area-analyzer
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
I'd like to report a bug in the Dart Editor.
If I define this class:
class DisplayObject extends EventDispatcher {
// Listing of mouse event names. Used in _hasMouseEventListener.
static const List<String> MOUSE_EVENTS = ['click', 'dblclick', 'mousedown',
'mouseout', 'mouseover', 'pressmove', 'pressup', 'rollout', 'rollover'];
}
The Dart Editor doesn't indicates that the literal list (the right hand of the assingment) should also have the "const" modifier. So if I try to print the class variable with:
void main() {
print(DisplayObject.MOUSE_EVENTS);
}
I get the following error:
/home/fomoto/src/dart/dart-sdk/bin/dart --enable-checked-mode --debug:43184 easel_dart_test.dart
'file:///home/fomoto/dart/easel_dart_test/web/easel_dart_test.dart': error: line 4 pos 33: circular dependency while initializing static field 'MOUSE_EVENTS'
print(DisplayObject.MOUSE_EVENTS);
^
Best regards,
Federico Omoto
////////////////////////////////////////////////////////////////////////////////////
Editor: 1.3.0.release (2014-04-08)
OS: Linux - amd64 (3.13.10-200.fc20.x86_64)
JVM: 1.7.0_55
projects: 3
open dart files: 6
auto-run pub: true
localhost resolves to: 127.0.0.1
mem max/total/free: 1778 / 834 / 602 MB
thread count: 33
index: 282097 relationships in 34691 keys in 505 sources
SDK installed: true
Dartium installed: true
The text was updated successfully, but these errors were encountered: