Issue 21886. Make enums available outside of the defining library.
R=brianwilkerson@google.com BUG= https://code.google.com/p/dart/issues/detail?id=21886 Review URL: https://codereview.chromium.org//809763002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42403 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
@@ -10244,6 +10244,9 @@ class NamespaceBuilder {
|
||||
for (PropertyAccessorElement element in compilationUnit.accessors) {
|
||||
_addIfPublic(definedNames, element);
|
||||
}
|
||||
for (ClassElement element in compilationUnit.enums) {
|
||||
_addIfPublic(definedNames, element);
|
||||
}
|
||||
for (FunctionElement element in compilationUnit.functions) {
|
||||
_addIfPublic(definedNames, element);
|
||||
}
|
||||
@@ -11362,6 +11365,13 @@ class ResolverVisitor extends ScopedVisitor {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares this [ResolverVisitor] to using it for incremental resolution.
|
||||
*/
|
||||
void initForIncrementalResolution() {
|
||||
_overrideManager.enterScope();
|
||||
}
|
||||
|
||||
/**
|
||||
* If it is appropriate to do so, override the current type of the static and propagated elements
|
||||
* associated with the given expression with the given type. Generally speaking, it is appropriate
|
||||
@@ -11609,13 +11619,6 @@ class ResolverVisitor extends ScopedVisitor {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares this [ResolverVisitor] to using it for incremental resolution.
|
||||
*/
|
||||
void initForIncrementalResolution() {
|
||||
_overrideManager.enterScope();
|
||||
}
|
||||
|
||||
@override
|
||||
Object visitCompilationUnit(CompilationUnit node) {
|
||||
//
|
||||
|
||||
@@ -8672,6 +8672,21 @@ main() {}''');
|
||||
verify([source]);
|
||||
}
|
||||
|
||||
void test_enum_externalLibrary() {
|
||||
resetWithEnum();
|
||||
addNamedSource("/my_lib.dart", r'''
|
||||
library my_lib;
|
||||
enum EEE {A, B, C}''');
|
||||
Source source = addSource(r'''
|
||||
import 'my_lib.dart';
|
||||
main() {
|
||||
EEE e = null;
|
||||
}''');
|
||||
resolve(source);
|
||||
assertNoErrors(source);
|
||||
verify([source]);
|
||||
}
|
||||
|
||||
void test_extractedMethodAsConstant() {
|
||||
Source source = addSource(r'''
|
||||
abstract class Comparable<T> {
|
||||
|
||||
Reference in New Issue
Block a user