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

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

Issue 2712913004: Work around the problem when type inference fails and StrongTypeSystemImpl.inferGenericFunctionCall… (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/task/strong/inferred_type_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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /** 5 /**
6 * This library is capable of producing linked summaries from unlinked 6 * This library is capable of producing linked summaries from unlinked
7 * ones (or prelinked ones). It functions by building a miniature 7 * ones (or prelinked ones). It functions by building a miniature
8 * element model to represent the contents of the summaries, and then 8 * element model to represent the contents of the summaries, and then
9 * scanning the element model to gather linked information and adding 9 * scanning the element model to gather linked information and adding
10 * it to the summary data structures. 10 * it to the summary data structures.
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 } else { 2365 } else {
2366 FunctionType rawType = StaticTypeAnalyzer 2366 FunctionType rawType = StaticTypeAnalyzer
2367 .constructorToGenericFunctionType(constructorElement); 2367 .constructorToGenericFunctionType(constructorElement);
2368 FunctionType inferredType = _inferExecutableType( 2368 FunctionType inferredType = _inferExecutableType(
2369 rawType, 2369 rawType,
2370 numNamed, 2370 numNamed,
2371 numPositional, 2371 numPositional,
2372 namedArgNames, 2372 namedArgNames,
2373 namedArgTypeList, 2373 namedArgTypeList,
2374 positionalArgTypes, const <DartType>[]); 2374 positionalArgTypes, const <DartType>[]);
2375 if (identical(inferredType, rawType)) { 2375 if (inferredType == null || identical(inferredType, rawType)) {
2376 inferredType = linker.typeSystem.instantiateToBounds(rawType); 2376 inferredType = linker.typeSystem.instantiateToBounds(rawType);
2377 } 2377 }
2378 return inferredType.returnType; 2378 return inferredType.returnType;
2379 } 2379 }
2380 }()); 2380 }());
2381 } else { 2381 } else {
2382 ClassElementForLink classElement = 2382 ClassElementForLink classElement =
2383 unit.resolveConstructorClassRef(ref.reference).asClass; 2383 unit.resolveConstructorClassRef(ref.reference).asClass;
2384 stack.add(classElement?.type ?? DynamicTypeImpl.instance); 2384 stack.add(classElement?.type ?? DynamicTypeImpl.instance);
2385 } 2385 }
(...skipping 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after
5131 * there are no type parameters in scope. 5131 * there are no type parameters in scope.
5132 */ 5132 */
5133 TypeParameterizedElementMixin get _typeParameterContext; 5133 TypeParameterizedElementMixin get _typeParameterContext;
5134 5134
5135 @override 5135 @override
5136 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 5136 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
5137 5137
5138 @override 5138 @override
5139 String toString() => '$enclosingElement.$name'; 5139 String toString() => '$enclosingElement.$name';
5140 } 5140 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698