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

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

Issue 2028713003: Fix AST-based type inference with explicit type parameters for method calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 import 'package:analyzer/dart/element/type.dart'; 5 import 'package:analyzer/dart/element/type.dart';
6 import 'package:analyzer/src/dart/element/element.dart'; 6 import 'package:analyzer/src/dart/element/element.dart';
7 import 'package:analyzer/src/summary/format.dart'; 7 import 'package:analyzer/src/summary/format.dart';
8 import 'package:analyzer/src/summary/idl.dart'; 8 import 'package:analyzer/src/summary/idl.dart';
9 import 'package:analyzer/src/summary/link.dart'; 9 import 'package:analyzer/src/summary/link.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 addBundle(bundle); 655 addBundle(bundle);
656 createLinker(''' 656 createLinker('''
657 import 'a.dart'; 657 import 'a.dart';
658 var y = x; 658 var y = x;
659 '''); 659 ''');
660 LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri); 660 LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
661 expect(_getVariable(library.getContainedName('y')).inferredType.toString(), 661 expect(_getVariable(library.getContainedName('y')).inferredType.toString(),
662 'dynamic'); 662 'dynamic');
663 } 663 }
664 664
665 @failingTest
666 void test_methodCall_withTypeArguments_topLevelVariable() {
667 // The following code is incorrect but it shouldn't crash analyzer.
668 // TODO(paulberry): fix this.
669 createLinker('var f = f/*<int>*/();');
670 LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
671 library.libraryCycleForLink.ensureLinked();
672 }
673
665 void test_multiplyInheritedExecutable_differentSignatures() { 674 void test_multiplyInheritedExecutable_differentSignatures() {
666 createLinker(''' 675 createLinker('''
667 class B { 676 class B {
668 void f() {} 677 void f() {}
669 } 678 }
670 abstract class I { 679 abstract class I {
671 f(); 680 f();
672 } 681 }
673 class C extends B with I {} 682 class C extends B with I {}
674 class D extends C { 683 class D extends C {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 PropertyAccessorElementForLink_Variable j = library.getContainedName('j'); 808 PropertyAccessorElementForLink_Variable j = library.getContainedName('j');
800 expect(j.variable.initializer, isNull); 809 expect(j.variable.initializer, isNull);
801 PropertyAccessorElementForLink_Variable v = library.getContainedName('v'); 810 PropertyAccessorElementForLink_Variable v = library.getContainedName('v');
802 expect(v.variable.initializer, isNotNull); 811 expect(v.variable.initializer, isNotNull);
803 } 812 }
804 813
805 VariableElementForLink _getVariable(ReferenceableElementForLink element) { 814 VariableElementForLink _getVariable(ReferenceableElementForLink element) {
806 return (element as PropertyAccessorElementForLink_Variable).variable; 815 return (element as PropertyAccessorElementForLink_Variable).variable;
807 } 816 }
808 } 817 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698