Skip to content
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

Hint for const #18413

Closed
stevemessick opened this issue Apr 24, 2014 · 5 comments
Closed

Hint for const #18413

stevemessick opened this issue Apr 24, 2014 · 5 comments
Assignees
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

Comments

@stevemessick
Copy link
Contributor

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

@kasperl
Copy link

kasperl commented May 8, 2014

Removed this from the 1.4 milestone.
Added this to the 1.5 milestone.

@bwilkerson
Copy link
Member

Removed this from the 1.5 milestone.
Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
@srawlins
Copy link
Member

There is now an error for this:

error: 'const' variables must be constant value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants