Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1212683002: AST changes necessary for generic method support (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 3a3374a2e2ae4e99d822c0fcb3a1b2527c128424..90065ecc2b1c59fa782acdf8edfed71580368ed1 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -520,6 +520,29 @@ class DeclarationMatcher extends RecursiveAstVisitor {
}
}
+ /**
+ * Asserts that there is an import with the same prefix as the given
+ * [prefixNode], which exposes the given [element].
+ */
+ void _assertElementVisibleWithPrefix(
+ SimpleIdentifier prefixNode, Element element) {
+ if (prefixNode == null) {
+ return;
+ }
+ String prefixName = prefixNode.name;
+ for (ImportElement import in _enclosingLibrary.imports) {
+ if (import.prefix != null && import.prefix.name == prefixName) {
+ Namespace namespace =
+ new NamespaceBuilder().createImportNamespaceForDirective(import);
+ Iterable<Element> visibleElements = namespace.definedNames.values;
+ if (visibleElements.contains(element)) {
+ return;
+ }
+ }
+ }
+ _assertTrue(false);
+ }
+
void _assertEquals(Object a, Object b) {
if (a != b) {
throw new _DeclarationMismatchException();
@@ -619,29 +642,6 @@ class DeclarationMatcher extends RecursiveAstVisitor {
}
}
- /**
- * Asserts that there is an import with the same prefix as the given
- * [prefixNode], which exposes the given [element].
- */
- void _assertElementVisibleWithPrefix(
- SimpleIdentifier prefixNode, Element element) {
- if (prefixNode == null) {
- return;
- }
- String prefixName = prefixNode.name;
- for (ImportElement import in _enclosingLibrary.imports) {
- if (import.prefix != null && import.prefix.name == prefixName) {
- Namespace namespace =
- new NamespaceBuilder().createImportNamespaceForDirective(import);
- Iterable<Element> visibleElements = namespace.definedNames.values;
- if (visibleElements.contains(element)) {
- return;
- }
- }
- }
- _assertTrue(false);
- }
-
void _assertSameTypeParameter(
TypeParameter node, TypeParameterElement element) {
_assertSameType(node.bound, element.bound);
@@ -1471,6 +1471,8 @@ class PoorMansIncrementalResolver {
Token token = _scan(code);
RecordingErrorListener errorListener = new RecordingErrorListener();
Parser parser = new Parser(_unitSource, errorListener);
+ AnalysisOptions options = _unitElement.context.analysisOptions;
+ parser.parseGenericMethods = options.enableGenericMethods;
CompilationUnit unit = parser.parseCompilationUnit(token);
_newParseErrors = errorListener.errors;
return unit;

Powered by Google App Engine
This is Rietveld 408576698