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

Side by Side Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2212233003: fix #26393, treat tear offs as definite functions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add regression test Created 4 years, 4 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 | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.task.strong.checker_test; 5 library analyzer.test.src.task.strong.checker_test;
6 6
7 import '../../../reflective_tests.dart'; 7 import '../../../reflective_tests.dart';
8 import 'strong_test_helper.dart'; 8 import 'strong_test_helper.dart';
9 9
10 void main() { 10 void main() {
(...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 } 2669 }
2670 2670
2671 class B implements A {} 2671 class B implements A {}
2672 2672
2673 class F { 2673 class F {
2674 void f(x) {} 2674 void f(x) {}
2675 void g(int x) {} 2675 void g(int x) {}
2676 } 2676 }
2677 2677
2678 class G extends F { 2678 class G extends F {
2679 /*error:INVALID_METHOD_OVERRIDE*/void f(int x) {} 2679 /*error:INVALID_METHOD_OVERRIDE*/void f(int x) {}
vsm 2016/08/08 20:07:14 Ah - looks like we're already testing that F.f has
Jennifer Messerly 2016/08/08 21:21:13 oh! yes I should've mentioned that, I also did a m
2680 void g(dynamic x) {} 2680 void g(dynamic x) {}
2681 } 2681 }
2682 2682
2683 class H implements F { 2683 class H implements F {
2684 /*error:INVALID_METHOD_OVERRIDE*/void f(int x) {} 2684 /*error:INVALID_METHOD_OVERRIDE*/void f(int x) {}
2685 void g(dynamic x) {} 2685 void g(dynamic x) {}
2686 } 2686 }
2687 '''); 2687 ''');
2688 } 2688 }
2689 2689
2690 void test_methodTearoffStrictArrow() {
2691 // Regression test for https://github.com/dart-lang/sdk/issues/26393
2692 checkFile(r'''
2693 class A {
2694 void foo(dynamic x) {}
2695 void test(void f(int x)) {
2696 test(foo);
2697 }
2698 }
2699 ''');
2700 }
2701
2690 void test_mixinOverrideOfGrandInterface_interfaceOfAbstractSuperclass() { 2702 void test_mixinOverrideOfGrandInterface_interfaceOfAbstractSuperclass() {
2691 checkFile(''' 2703 checkFile('''
2692 class A {} 2704 class A {}
2693 class B {} 2705 class B {}
2694 2706
2695 abstract class I1 { 2707 abstract class I1 {
2696 m(A a); 2708 m(A a);
2697 } 2709 }
2698 abstract class Base implements I1 {} 2710 abstract class Base implements I1 {}
2699 2711
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 // Regression test for https://github.com/dart-lang/sdk/issues/25069 3660 // Regression test for https://github.com/dart-lang/sdk/issues/25069
3649 checkFile(''' 3661 checkFile('''
3650 typedef int Foo(); 3662 typedef int Foo();
3651 void foo() {} 3663 void foo() {}
3652 void main () { 3664 void main () {
3653 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); 3665 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo();
3654 } 3666 }
3655 '''); 3667 ''');
3656 } 3668 }
3657 } 3669 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698