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

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1847633002: Fix more strong mode errors in analyzer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix copied comment Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 components.add(name); 716 components.add(name);
717 ElementLocationImpl location = new ElementLocationImpl.con3(components); 717 ElementLocationImpl location = new ElementLocationImpl.con3(components);
718 return new _DeferredConstructorElement._(definingType, name, location); 718 return new _DeferredConstructorElement._(definingType, name, location);
719 } 719 }
720 720
721 _DeferredConstructorElement._( 721 _DeferredConstructorElement._(
722 this._definingType, this.name, ElementLocation location) 722 this._definingType, this.name, ElementLocation location)
723 : super(null, location); 723 : super(null, location);
724 724
725 @override 725 @override
726 Element get actualElement => enclosingElement.getNamedConstructor(name); 726 ConstructorElement get actualElement =>
727 enclosingElement.getNamedConstructor(name);
727 728
728 @override 729 @override
729 AnalysisContext get context => _definingType.element.context; 730 AnalysisContext get context => _definingType.element.context;
730 731
731 @override 732 @override
732 String get displayName => name; 733 String get displayName => name;
733 734
734 @override 735 @override
735 ClassElement get enclosingElement { 736 ClassElement get enclosingElement {
736 return _definingType.element; 737 return _definingType.element;
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 FunctionTypedElement element = this.element; 1319 FunctionTypedElement element = this.element;
1319 for (int index in implicitFunctionTypeIndices) { 1320 for (int index in implicitFunctionTypeIndices) {
1320 element = element.parameters[index].type.element; 1321 element = element.parameters[index].type.element;
1321 } 1322 }
1322 return element; 1323 return element;
1323 }; 1324 };
1324 } else { 1325 } else {
1325 // For a type that refers to a generic executable, the type arguments ar e 1326 // For a type that refers to a generic executable, the type arguments ar e
1326 // not supposed to include the arguments to the executable itself. 1327 // not supposed to include the arguments to the executable itself.
1327 numTypeArguments = enclosing == null ? 0 : enclosing.numTypeParameters; 1328 numTypeArguments = enclosing == null ? 0 : enclosing.numTypeParameters;
1328 computer = () => this.element; 1329 computer = () => this.element as FunctionTypedElement;
1329 } 1330 }
1330 // TODO(paulberry): Is it a bug that we have to pass `false` for 1331 // TODO(paulberry): Is it a bug that we have to pass `false` for
1331 // isInstantiated? 1332 // isInstantiated?
1332 return new DeferredFunctionTypeImpl(computer, null, 1333 return new DeferredFunctionTypeImpl(computer, null,
1333 _buildTypeArguments(numTypeArguments, getTypeArgument), false); 1334 _buildTypeArguments(numTypeArguments, getTypeArgument), false);
1334 } else { 1335 } else {
1335 return null; 1336 return null;
1336 } 1337 }
1337 } 1338 }
1338 1339
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2591 static String _getElementIdentifier(String name, ReferenceKind kind) { 2592 static String _getElementIdentifier(String name, ReferenceKind kind) {
2592 if (kind == ReferenceKind.topLevelPropertyAccessor || 2593 if (kind == ReferenceKind.topLevelPropertyAccessor ||
2593 kind == ReferenceKind.propertyAccessor) { 2594 kind == ReferenceKind.propertyAccessor) {
2594 if (!name.endsWith('=')) { 2595 if (!name.endsWith('=')) {
2595 return name + '?'; 2596 return name + '?';
2596 } 2597 }
2597 } 2598 }
2598 return name; 2599 return name;
2599 } 2600 }
2600 } 2601 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698