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

Side by Side Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1546223003: Issue 25314. Fix for incremental resolution of a function expression body in class declaration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.incremental_resolver; 5 library analyzer.src.generated.incremental_resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 30 matching lines...) Expand all
41 void set test_resolveApiChanges(bool value) { 41 void set test_resolveApiChanges(bool value) {
42 _resolveApiChanges = value; 42 _resolveApiChanges = value;
43 } 43 }
44 44
45 /** 45 /**
46 * Instances of the class [DeclarationMatcher] determine whether the element 46 * Instances of the class [DeclarationMatcher] determine whether the element
47 * model defined by a given AST structure matches an existing element model. 47 * model defined by a given AST structure matches an existing element model.
48 */ 48 */
49 class DeclarationMatcher extends RecursiveAstVisitor { 49 class DeclarationMatcher extends RecursiveAstVisitor {
50 /** 50 /**
51 * The libary containing the AST nodes being visited. 51 * The library containing the AST nodes being visited.
52 */ 52 */
53 LibraryElement _enclosingLibrary; 53 LibraryElement _enclosingLibrary;
54 54
55 /** 55 /**
56 * The compilation unit containing the AST nodes being visited. 56 * The compilation unit containing the AST nodes being visited.
57 */ 57 */
58 CompilationUnitElement _enclosingUnit; 58 CompilationUnitElement _enclosingUnit;
59 59
60 /** 60 /**
61 * The function type alias containing the AST nodes being visited, or `null` i f we are not 61 * The function type alias containing the AST nodes being visited, or `null` i f we are not
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 _hasConstructor = false; 158 _hasConstructor = false;
159 super.visitClassDeclaration(node); 159 super.visitClassDeclaration(node);
160 // process default constructor 160 // process default constructor
161 if (!_hasConstructor) { 161 if (!_hasConstructor) {
162 ConstructorElement constructor = element.unnamedConstructor; 162 ConstructorElement constructor = element.unnamedConstructor;
163 _processElement(constructor); 163 _processElement(constructor);
164 if (!constructor.isSynthetic) { 164 if (!constructor.isSynthetic) {
165 _assertEquals(constructor.parameters.length, 0); 165 _assertEquals(constructor.parameters.length, 0);
166 } 166 }
167 } 167 }
168 // matches, set the element
169 node.name.staticElement = element;
168 } 170 }
169 171
170 @override 172 @override
171 visitClassTypeAlias(ClassTypeAlias node) { 173 visitClassTypeAlias(ClassTypeAlias node) {
172 String name = node.name.name; 174 String name = node.name.name;
173 ClassElement element = _findElement(_enclosingUnit.types, name); 175 ClassElement element = _findElement(_enclosingUnit.types, name);
174 _enclosingClass = element; 176 _enclosingClass = element;
175 _processElement(element); 177 _processElement(element);
176 _assertSameTypeParameters(node.typeParameters, element.typeParameters); 178 _assertSameTypeParameters(node.typeParameters, element.typeParameters);
177 super.visitClassTypeAlias(node); 179 super.visitClassTypeAlias(node);
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 @override 2096 @override
2095 String toString() => name; 2097 String toString() => name;
2096 } 2098 }
2097 2099
2098 class _TokenPair { 2100 class _TokenPair {
2099 final _TokenDifferenceKind kind; 2101 final _TokenDifferenceKind kind;
2100 final Token oldToken; 2102 final Token oldToken;
2101 final Token newToken; 2103 final Token newToken;
2102 _TokenPair(this.kind, this.oldToken, this.newToken); 2104 _TokenPair(this.kind, this.oldToken, this.newToken);
2103 } 2105 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698