Index: pkg/analyzer/lib/src/generated/constant.dart |
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart |
index 5a3f445a88663d845a7ece8f9f7e73be88c1c5ba..aca4af5bfef2141dec78546b3ae60825e23d87ed 100644 |
--- a/pkg/analyzer/lib/src/generated/constant.dart |
+++ b/pkg/analyzer/lib/src/generated/constant.dart |
@@ -1234,8 +1234,9 @@ class ConstantFinder extends RecursiveAstVisitor<Object> { |
@override |
Object visitAnnotation(Annotation node) { |
super.visitAnnotation(node); |
+ AnalysisContext owningContext = _getOwningContext(); |
constantsToCompute.add(new ConstantEvaluationTarget_Annotation( |
- context, source, librarySource, node)); |
+ owningContext, source, librarySource, node)); |
return null; |
} |
@@ -1285,6 +1286,14 @@ class ConstantFinder extends RecursiveAstVisitor<Object> { |
} |
return null; |
} |
+ |
+ AnalysisContext _getOwningContext() { |
+ if (context is InternalAnalysisContext) { |
+ InternalAnalysisContext internalContext = context; |
+ return internalContext.getContextFor(librarySource); |
+ } |
+ return context; |
+ } |
} |
/** |