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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart

Issue 1874123002: Infer generic method invocation type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge, additional tests and fixes. Created 4 years, 8 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 library analyzer.test.src.summary.resynthesize_ast_test; 5 library analyzer.test.src.summary.resynthesize_ast_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/src/dart/element/element.dart'; 9 import 'package:analyzer/src/dart/element/element.dart';
10 import 'package:analyzer/src/generated/engine.dart' 10 import 'package:analyzer/src/generated/engine.dart'
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 void test_inferTypesOnGenericInstantiations_5() { 399 void test_inferTypesOnGenericInstantiations_5() {
400 super.test_inferTypesOnGenericInstantiations_5(); 400 super.test_inferTypesOnGenericInstantiations_5();
401 } 401 }
402 402
403 @override 403 @override
404 @failingTest 404 @failingTest
405 void test_inferTypesOnGenericInstantiationsInLibraryCycle() { 405 void test_inferTypesOnGenericInstantiationsInLibraryCycle() {
406 super.test_inferTypesOnGenericInstantiationsInLibraryCycle(); 406 super.test_inferTypesOnGenericInstantiationsInLibraryCycle();
407 } 407 }
408 408
409 void test_invokeMethod_notGeneric_genericClass() {
410 var unit = checkFile(r'''
411 class C<T> {
412 T m(int a, {String b, T c}) => null;
413 }
414 var v = new C<double>().m(1, b: 'bbb', c: 2.0);
415 ''');
416 expect(unit.topLevelVariables[0].type.toString(), 'double');
417 }
418
419 void test_invokeMethod_notGeneric_notGenericClass() {
420 var unit = checkFile(r'''
421 class C {
422 int m(int a, {String b, int c}) => null;
423 }
424 var v = new C().m(1, b: 'bbb', c: 2.0);
425 ''');
426 expect(unit.topLevelVariables[0].type.toString(), 'int');
427 }
428
409 @override 429 @override
410 @failingTest 430 @failingTest
411 void test_listLiteralsShouldNotInferBottom() { 431 void test_listLiteralsShouldNotInferBottom() {
412 super.test_listLiteralsShouldNotInferBottom(); 432 super.test_listLiteralsShouldNotInferBottom();
413 } 433 }
414 434
415 @override 435 @override
416 @failingTest 436 @failingTest
417 void test_mapLiteralsShouldNotInferBottom() { 437 void test_mapLiteralsShouldNotInferBottom() {
418 super.test_mapLiteralsShouldNotInferBottom(); 438 super.test_mapLiteralsShouldNotInferBottom();
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 } 633 }
614 634
615 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); 635 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource);
616 LinkedLibraryBuilder linkedLibrary = 636 LinkedLibraryBuilder linkedLibrary =
617 prelink(definingUnit, getPart, getImport); 637 prelink(definingUnit, getPart, getImport);
618 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { 638 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) {
619 _serializeLibrary(resolveRelativeUri(d.uri)); 639 _serializeLibrary(resolveRelativeUri(d.uri));
620 }); 640 });
621 } 641 }
622 } 642 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | 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