Issue 22426 in dart: Enum can not be imported in another dart file

40 views
Skip to first unread message

da...@googlecode.com

unread,
Feb 15, 2015, 1:19:48 AM2/15/15
to bu...@dartlang.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Unassigned

New issue 22426 by jp_menet...@yahoo.fr: Enum can not be imported in
another dart file
https://code.google.com/p/dart/issues/detail?id=22426


In File 1: "TestEnum.dart"

enum TestEnum {
VAL1,
VAL2
}


In File 2: "UseEnum.dart"

import 'TestEnum.dart'; // Error on this line : Unused import

void testEnum() {

TestEnum v = TestEnum.VAL1; // Error on this line : Undefined
class 'TestEnum'

}

So importing a file with an enum and use it does not work.
(same test with a class works of course)


Dart Editor version 1.8.5.release (STABLE)
Dart SDK version 1.8.5

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
Feb 15, 2015, 12:32:13 PM2/15/15
to bu...@dartlang.org
Updates:
Status: CannotReproduce
Owner: brianwi...@google.com
Labels: -Priority-Unassigned Priority-High Area-Analyzer Milestone-1.9

Comment #1 on issue 22426 by brianwi...@google.com: Enum can not be
I cannot reproduce this behavior. When I created files with the content you
gave, the only thing I got from the analyzer (in Editor) was an indication
that the variable 'v' wasn't being used. I believe that we have fixed this
issue. Please let us know if you're still seeing this after updating to the
next stable or dev release.

da...@googlecode.com

unread,
Feb 15, 2015, 1:18:33 PM2/15/15
to bu...@dartlang.org

Comment #2 on issue 22426 by jp_menet...@yahoo.fr: Enum can not be imported
thanks to have looked to this problem.

I will check it with the next stable version when it will be available
Reply all
Reply to author
Forward
0 new messages