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

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

Issue 2662983005: Fix for resynthesizing invalid elements as type arguments of declared types. (Closed)
Patch Set: Created 3 years, 10 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/src/summary/resynthesize_common.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 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 } 1618 }
1619 if (type.paramReference != 0) { 1619 if (type.paramReference != 0) {
1620 return typeParameterContext.getTypeParameterType(type.paramReference); 1620 return typeParameterContext.getTypeParameterType(type.paramReference);
1621 } else if (type.syntheticReturnType != null) { 1621 } else if (type.syntheticReturnType != null) {
1622 FunctionElementImpl element = 1622 FunctionElementImpl element =
1623 new FunctionElementImpl_forLUB(unit, typeParameterContext, type); 1623 new FunctionElementImpl_forLUB(unit, typeParameterContext, type);
1624 return element.type; 1624 return element.type;
1625 } else { 1625 } else {
1626 DartType getTypeArgument(int i) { 1626 DartType getTypeArgument(int i) {
1627 if (i < type.typeArguments.length) { 1627 if (i < type.typeArguments.length) {
1628 return buildType(type.typeArguments[i], typeParameterContext); 1628 return buildType(type.typeArguments[i], typeParameterContext,
1629 declaredType: declaredType);
1629 } else { 1630 } else {
1630 return DynamicTypeImpl.instance; 1631 return DynamicTypeImpl.instance;
1631 } 1632 }
1632 } 1633 }
1633 1634
1634 _ReferenceInfo referenceInfo = getReferenceInfo(type.reference); 1635 _ReferenceInfo referenceInfo = getReferenceInfo(type.reference);
1635 if (declaredType && !referenceInfo.isDeclarableType) { 1636 if (declaredType && !referenceInfo.isDeclarableType) {
1636 return DynamicTypeImpl.instance; 1637 return DynamicTypeImpl.instance;
1637 } 1638 }
1638 return referenceInfo.buildType( 1639 return referenceInfo.buildType(
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 static String _getElementIdentifier(String name, ReferenceKind kind) { 1917 static String _getElementIdentifier(String name, ReferenceKind kind) {
1917 if (kind == ReferenceKind.topLevelPropertyAccessor || 1918 if (kind == ReferenceKind.topLevelPropertyAccessor ||
1918 kind == ReferenceKind.propertyAccessor) { 1919 kind == ReferenceKind.propertyAccessor) {
1919 if (!name.endsWith('=')) { 1920 if (!name.endsWith('=')) {
1920 return name + '?'; 1921 return name + '?';
1921 } 1922 }
1922 } 1923 }
1923 return name; 1924 return name;
1924 } 1925 }
1925 } 1926 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698