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

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

Issue 2735033002: Fix for 'const C.named()' type inference when 'C' is resolved and has type parameters, but 'named' … (Closed)
Patch Set: Created 3 years, 9 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) 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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 positionalArgTypes, const <DartType>[]); 2374 positionalArgTypes, const <DartType>[]);
2375 if (inferredType == null || 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 DartType inferredType;
2385 if (classElement != null) {
2386 InterfaceType rawType = classElement.type;
2387 inferredType = linker.typeSystem.instantiateToBounds(rawType);
2388 } else {
2389 inferredType = DynamicTypeImpl.instance;
2390 }
2391 stack.add(inferredType);
2385 } 2392 }
2386 } 2393 }
2387 2394
2388 void _doInvokeMethod() { 2395 void _doInvokeMethod() {
2389 int numNamed = unlinkedConst.ints[intPtr++]; 2396 int numNamed = unlinkedConst.ints[intPtr++];
2390 int numPositional = unlinkedConst.ints[intPtr++]; 2397 int numPositional = unlinkedConst.ints[intPtr++];
2391 List<String> namedArgNames = _getNextStrings(numNamed); 2398 List<String> namedArgNames = _getNextStrings(numNamed);
2392 List<DartType> namedArgTypeList = _popList(numNamed); 2399 List<DartType> namedArgTypeList = _popList(numNamed);
2393 List<DartType> positionalArgTypes = _popList(numPositional); 2400 List<DartType> positionalArgTypes = _popList(numPositional);
2394 // TODO(scheglov) if we pushed target and method name first, we might be 2401 // TODO(scheglov) if we pushed target and method name first, we might be
(...skipping 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after
5131 * there are no type parameters in scope. 5138 * there are no type parameters in scope.
5132 */ 5139 */
5133 TypeParameterizedElementMixin get _typeParameterContext; 5140 TypeParameterizedElementMixin get _typeParameterContext;
5134 5141
5135 @override 5142 @override
5136 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 5143 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
5137 5144
5138 @override 5145 @override
5139 String toString() => '$enclosingElement.$name'; 5146 String toString() => '$enclosingElement.$name';
5140 } 5147 }
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