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

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

Issue 2628013002: Don't instantiate a new InterfaceTypeImpl for a ClassElement without type parameters. (Closed)
Patch Set: Created 3 years, 11 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/strong_mode_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) 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/standard_ast_factory.dart'; 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 * [EntityRef.implicitFunctionTypeIndices]. 1302 * [EntityRef.implicitFunctionTypeIndices].
1303 */ 1303 */
1304 DartType _buildType(bool instantiateToBoundsAllowed, int numTypeArguments, 1304 DartType _buildType(bool instantiateToBoundsAllowed, int numTypeArguments,
1305 DartType getTypeArgument(int i), List<int> implicitFunctionTypeIndices) { 1305 DartType getTypeArgument(int i), List<int> implicitFunctionTypeIndices) {
1306 ElementHandle element = this.element; // To allow type promotion 1306 ElementHandle element = this.element; // To allow type promotion
1307 if (element is ClassElementHandle) { 1307 if (element is ClassElementHandle) {
1308 List<DartType> typeArguments = null; 1308 List<DartType> typeArguments = null;
1309 // If type arguments are specified, use them. 1309 // If type arguments are specified, use them.
1310 // Otherwise, delay until they are requested. 1310 // Otherwise, delay until they are requested.
1311 if (numTypeParameters == 0) { 1311 if (numTypeParameters == 0) {
1312 typeArguments = const <DartType>[]; 1312 return element.type;
1313 } else if (numTypeArguments == numTypeParameters) { 1313 } else if (numTypeArguments == numTypeParameters) {
1314 typeArguments = new List<DartType>(numTypeParameters); 1314 typeArguments = new List<DartType>(numTypeParameters);
1315 for (int i = 0; i < numTypeParameters; i++) { 1315 for (int i = 0; i < numTypeParameters; i++) {
1316 typeArguments[i] = getTypeArgument(i); 1316 typeArguments[i] = getTypeArgument(i);
1317 } 1317 }
1318 } 1318 }
1319 InterfaceTypeImpl type = 1319 InterfaceTypeImpl type =
1320 new InterfaceTypeImpl.elementWithNameAndArgs(element, name, () { 1320 new InterfaceTypeImpl.elementWithNameAndArgs(element, name, () {
1321 if (typeArguments == null) { 1321 if (typeArguments == null) {
1322 typeArguments = element.typeParameters 1322 typeArguments = element.typeParameters
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 static String _getElementIdentifier(String name, ReferenceKind kind) { 1912 static String _getElementIdentifier(String name, ReferenceKind kind) {
1913 if (kind == ReferenceKind.topLevelPropertyAccessor || 1913 if (kind == ReferenceKind.topLevelPropertyAccessor ||
1914 kind == ReferenceKind.propertyAccessor) { 1914 kind == ReferenceKind.propertyAccessor) {
1915 if (!name.endsWith('=')) { 1915 if (!name.endsWith('=')) {
1916 return name + '?'; 1916 return name + '?';
1917 } 1917 }
1918 } 1918 }
1919 return name; 1919 return name;
1920 } 1920 }
1921 } 1921 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698