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

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

Issue 2343713002: fix #27151, list and map literals infer using up and down info (Closed)
Patch Set: format Created 4 years, 3 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) 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 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 rawMethodType.namedParameterTypes; 2617 rawMethodType.namedParameterTypes;
2618 namedArgTypes.forEach((String name, DartType argType) { 2618 namedArgTypes.forEach((String name, DartType argType) {
2619 DartType parameterType = namedParameterTypes[name]; 2619 DartType parameterType = namedParameterTypes[name];
2620 if (parameterType != null) { 2620 if (parameterType != null) {
2621 paramTypes.add(parameterType); 2621 paramTypes.add(parameterType);
2622 argTypes.add(argType); 2622 argTypes.add(argType);
2623 } 2623 }
2624 }); 2624 });
2625 // Perform inference. 2625 // Perform inference.
2626 FunctionType inferred = ts.inferGenericFunctionCall( 2626 FunctionType inferred = ts.inferGenericFunctionCall(
2627 typeProvider, rawMethodType, paramTypes, argTypes, null); 2627 typeProvider,
2628 rawMethodType,
2629 paramTypes,
2630 argTypes,
2631 rawMethodType.returnType,
2632 null);
2628 return inferred; 2633 return inferred;
2629 } 2634 }
2630 } 2635 }
2631 // Not a generic function type, use the raw type. 2636 // Not a generic function type, use the raw type.
2632 return rawMethodType; 2637 return rawMethodType;
2633 } 2638 }
2634 2639
2635 DartType _leastUpperBound(DartType s, DartType t) { 2640 DartType _leastUpperBound(DartType s, DartType t) {
2636 return linker.typeSystem.getLeastUpperBound(typeProvider, s, t); 2641 return linker.typeSystem.getLeastUpperBound(typeProvider, s, t);
2637 } 2642 }
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after
4962 * there are no type parameters in scope. 4967 * there are no type parameters in scope.
4963 */ 4968 */
4964 TypeParameterizedElementMixin get _typeParameterContext; 4969 TypeParameterizedElementMixin get _typeParameterContext;
4965 4970
4966 @override 4971 @override
4967 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 4972 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
4968 4973
4969 @override 4974 @override
4970 String toString() => '$enclosingElement.$name'; 4975 String toString() => '$enclosingElement.$name';
4971 } 4976 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698