| OLD | NEW |
| 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 'package:test_reflective_loader/test_reflective_loader.dart'; | 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 8 | 8 |
| 9 import 'strong_test_helper.dart'; | 9 import 'strong_test_helper.dart'; |
| 10 | 10 |
| (...skipping 3660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3671 | 3671 |
| 3672 void test_superConstructor() { | 3672 void test_superConstructor() { |
| 3673 checkFile(''' | 3673 checkFile(''' |
| 3674 class A { A(A x) {} } | 3674 class A { A(A x) {} } |
| 3675 class B extends A { | 3675 class B extends A { |
| 3676 B() : super(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3); | 3676 B() : super(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3); |
| 3677 } | 3677 } |
| 3678 '''); | 3678 '''); |
| 3679 } | 3679 } |
| 3680 | 3680 |
| 3681 void test_tearOffTreatedConsistentlyAsStrictArrow() { |
| 3682 checkFile(r''' |
| 3683 void foo(void f(String x)) {} |
| 3684 |
| 3685 class A { |
| 3686 Null bar1(dynamic x) => null; |
| 3687 void bar2(dynamic x) => null; |
| 3688 Null bar3(String x) => null; |
| 3689 void test() { |
| 3690 foo(bar1); |
| 3691 foo(bar2); |
| 3692 foo(bar3); |
| 3693 } |
| 3694 } |
| 3695 |
| 3696 |
| 3697 Null baz1(dynamic x) => null; |
| 3698 void baz2(dynamic x) => null; |
| 3699 Null baz3(String x) => null; |
| 3700 void test() { |
| 3701 foo(baz1); |
| 3702 foo(baz2); |
| 3703 foo(baz3); |
| 3704 } |
| 3705 '''); |
| 3706 } |
| 3707 |
| 3681 void test_ternaryOperator() { | 3708 void test_ternaryOperator() { |
| 3682 checkFile(''' | 3709 checkFile(''' |
| 3683 abstract class Comparable<T> { | 3710 abstract class Comparable<T> { |
| 3684 int compareTo(T other); | 3711 int compareTo(T other); |
| 3685 static int compare(Comparable a, Comparable b) => a.compareTo(b); | 3712 static int compare(Comparable a, Comparable b) => a.compareTo(b); |
| 3686 } | 3713 } |
| 3687 typedef int Comparator<T>(T a, T b); | 3714 typedef int Comparator<T>(T a, T b); |
| 3688 | 3715 |
| 3689 typedef bool _Predicate<T>(T value); | 3716 typedef bool _Predicate<T>(T value); |
| 3690 | 3717 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4088 // Regression test for https://github.com/dart-lang/sdk/issues/25069 | 4115 // Regression test for https://github.com/dart-lang/sdk/issues/25069 |
| 4089 checkFile(''' | 4116 checkFile(''' |
| 4090 typedef int Foo(); | 4117 typedef int Foo(); |
| 4091 void foo() {} | 4118 void foo() {} |
| 4092 void main () { | 4119 void main () { |
| 4093 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); | 4120 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); |
| 4094 } | 4121 } |
| 4095 '''); | 4122 '''); |
| 4096 } | 4123 } |
| 4097 } | 4124 } |
| OLD | NEW |