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

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

Issue 1053813002: Issue 23068. Constructors should have the same const/factory modifiers to match. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« 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 engine.incremental_resolver; 5 library engine.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/src/generated/constant.dart'; 10 import 'package:analyzer/src/generated/constant.dart';
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 179
180 @override 180 @override
181 visitConstructorDeclaration(ConstructorDeclaration node) { 181 visitConstructorDeclaration(ConstructorDeclaration node) {
182 _hasConstructor = true; 182 _hasConstructor = true;
183 SimpleIdentifier constructorName = node.name; 183 SimpleIdentifier constructorName = node.name;
184 ConstructorElementImpl element = constructorName == null 184 ConstructorElementImpl element = constructorName == null
185 ? _enclosingClass.unnamedConstructor 185 ? _enclosingClass.unnamedConstructor
186 : _enclosingClass.getNamedConstructor(constructorName.name); 186 : _enclosingClass.getNamedConstructor(constructorName.name);
187 _processElement(element); 187 _processElement(element);
188 _assertEquals(node.constKeyword != null, element.isConst);
189 _assertEquals(node.factoryKeyword != null, element.isFactory);
188 _assertCompatibleParameters(node.parameters, element.parameters); 190 _assertCompatibleParameters(node.parameters, element.parameters);
189 // TODO(scheglov) debug null Location 191 // TODO(scheglov) debug null Location
190 if (element != null) { 192 if (element != null) {
191 if (element.context == null || element.source == null) { 193 if (element.context == null || element.source == null) {
192 logger.log( 194 logger.log(
193 'Bad constructor element $element for $node in ${node.parent}'); 195 'Bad constructor element $element for $node in ${node.parent}');
194 } 196 }
195 } 197 }
196 // matches, update the existing element 198 // matches, update the existing element
197 ExecutableElement newElement = node.element; 199 ExecutableElement newElement = node.element;
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 @override 1842 @override
1841 String toString() => name; 1843 String toString() => name;
1842 } 1844 }
1843 1845
1844 class _TokenPair { 1846 class _TokenPair {
1845 final _TokenDifferenceKind kind; 1847 final _TokenDifferenceKind kind;
1846 final Token oldToken; 1848 final Token oldToken;
1847 final Token newToken; 1849 final Token newToken;
1848 _TokenPair(this.kind, this.oldToken, this.newToken); 1850 _TokenPair(this.kind, this.oldToken, this.newToken);
1849 } 1851 }
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