| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 StrFun f4 = foo; | 490 StrFun f4 = foo; |
| 491 f4("hello"); | 491 f4("hello"); |
| 492 a.baz1("hello"); | 492 a.baz1("hello"); |
| 493 var b1 = a.baz1; | 493 var b1 = a.baz1; |
| 494 (/*info:DYNAMIC_INVOKE*/b1("hello")); | 494 (/*info:DYNAMIC_INVOKE*/b1("hello")); |
| 495 A.baz2("hello"); | 495 A.baz2("hello"); |
| 496 var b2 = A.baz2; | 496 var b2 = A.baz2; |
| 497 (/*info:DYNAMIC_INVOKE*/b2("hello")); | 497 (/*info:DYNAMIC_INVOKE*/b2("hello")); |
| 498 | 498 |
| 499 dynamic a1 = new B(); | 499 dynamic a1 = new B(); |
| 500 (/*info:DYNAMIC_INVOKE*/a1./*info:UNDEFINED_GETTER*/x); | 500 (/*info:DYNAMIC_INVOKE*/a1.x); |
| 501 a1.toString(); | 501 a1.toString(); |
| 502 (/*info:DYNAMIC_INVOKE*/a1.toString(42)); | 502 (/*info:DYNAMIC_INVOKE*/a1.toString(42)); |
| 503 var toStringClosure = a1.toString; | 503 var toStringClosure = a1.toString; |
| 504 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure()); | 504 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure()); |
| 505 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure(42)); | 505 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure(42)); |
| 506 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure("hello")); | 506 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure("hello")); |
| 507 a1.hashCode; | 507 a1.hashCode; |
| 508 | 508 |
| 509 dynamic toString = () => null; | 509 dynamic toString = () => null; |
| 510 (/*info:DYNAMIC_INVOKE*/toString()); | 510 (/*info:DYNAMIC_INVOKE*/toString()); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 y = /*error:INVALID_ASSIGNMENT*/f(3); | 652 y = /*error:INVALID_ASSIGNMENT*/f(3); |
| 653 y = f.col(3.0); | 653 y = f.col(3.0); |
| 654 f(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3.0); | 654 f(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3.0); |
| 655 f.col(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3); | 655 f.col(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3); |
| 656 } | 656 } |
| 657 { | 657 { |
| 658 Function f = new B(); | 658 Function f = new B(); |
| 659 int x; | 659 int x; |
| 660 double y; | 660 double y; |
| 661 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); | 661 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); |
| 662 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE, info:INVALID_ASSIGNMENT*/f.col
(3.0); | 662 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f.col(3.0); |
| 663 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); | 663 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); |
| 664 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f.col(3.0); | 664 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f.col(3.0); |
| 665 /*info:DYNAMIC_INVOKE*/f(3.0); | 665 /*info:DYNAMIC_INVOKE*/f(3.0); |
| 666 // Through type propagation, we know f is actually a B, hence the | 666 // Through type propagation, we know f is actually a B, hence the |
| 667 // hint. | 667 // hint. |
| 668 /*info:DYNAMIC_INVOKE*/f.col(/*info:ARGUMENT_TYPE_NOT_ASSIGNABLE*/3); | 668 /*info:DYNAMIC_INVOKE*/f.col(3); |
| 669 } | 669 } |
| 670 { | 670 { |
| 671 A f = new B(); | 671 A f = new B(); |
| 672 int x; | 672 int x; |
| 673 double y; | 673 double y; |
| 674 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); | 674 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); |
| 675 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); | 675 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); |
| 676 /*info:DYNAMIC_INVOKE*/f(3.0); | 676 /*info:DYNAMIC_INVOKE*/f(3.0); |
| 677 } | 677 } |
| 678 { | 678 { |
| 679 dynamic g = new B(); | 679 dynamic g = new B(); |
| 680 /*info:DYNAMIC_INVOKE*/g.call(/*info:ARGUMENT_TYPE_NOT_ASSIGNABLE*/32.0); | 680 /*info:DYNAMIC_INVOKE*/g.call(32.0); |
| 681 /*info:DYNAMIC_INVOKE*/g.col(42.0); | 681 /*info:DYNAMIC_INVOKE*/g.col(42.0); |
| 682 /*info:DYNAMIC_INVOKE*/g.foo(42.0); | 682 /*info:DYNAMIC_INVOKE*/g.foo(42.0); |
| 683 /*info:DYNAMIC_INVOKE*/g./*info:UNDEFINED_GETTER*/x; | 683 /*info:DYNAMIC_INVOKE*/g.x; |
| 684 A f = new B(); | 684 A f = new B(); |
| 685 /*info:DYNAMIC_INVOKE*/f.col(42.0); | 685 /*info:DYNAMIC_INVOKE*/f.col(42.0); |
| 686 /*info:DYNAMIC_INVOKE*/f.foo(42.0); | 686 /*info:DYNAMIC_INVOKE*/f.foo(42.0); |
| 687 /*info:DYNAMIC_INVOKE*/f./*error:UNDEFINED_GETTER*/x; | 687 /*info:DYNAMIC_INVOKE*/f./*error:UNDEFINED_GETTER*/x; |
| 688 } | 688 } |
| 689 } | 689 } |
| 690 '''); | 690 '''); |
| 691 } | 691 } |
| 692 | 692 |
| 693 void test_factoryConstructorDowncast() { | 693 void test_factoryConstructorDowncast() { |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 top = right; | 1397 top = right; |
| 1398 top = bot; | 1398 top = bot; |
| 1399 top = top; | 1399 top = top; |
| 1400 top = left; | 1400 top = left; |
| 1401 | 1401 |
| 1402 left = /*warning:DOWN_CAST_COMPOSITE*/top; | 1402 left = /*warning:DOWN_CAST_COMPOSITE*/top; |
| 1403 left = left; | 1403 left = left; |
| 1404 left = /*error:INVALID_ASSIGNMENT*/right; | 1404 left = /*error:INVALID_ASSIGNMENT*/right; |
| 1405 left = bot; | 1405 left = bot; |
| 1406 | 1406 |
| 1407 right = /*info:INVALID_ASSIGNMENT,warning:DOWN_CAST_COMPOSITE*/top; | 1407 right = /*warning:DOWN_CAST_COMPOSITE*/top; |
| 1408 right = /*error:INVALID_ASSIGNMENT*/left; | 1408 right = /*error:INVALID_ASSIGNMENT*/left; |
| 1409 right = /*info:INVALID_ASSIGNMENT*/right; | 1409 right = right; |
| 1410 right = bot; | 1410 right = bot; |
| 1411 | 1411 |
| 1412 bot = /*warning:DOWN_CAST_COMPOSITE*/top; | 1412 bot = /*warning:DOWN_CAST_COMPOSITE*/top; |
| 1413 bot = /*warning:DOWN_CAST_COMPOSITE*/left; | 1413 bot = /*warning:DOWN_CAST_COMPOSITE*/left; |
| 1414 bot = /*warning:DOWN_CAST_COMPOSITE*/right; | 1414 bot = /*warning:DOWN_CAST_COMPOSITE*/right; |
| 1415 bot = bot; | 1415 bot = bot; |
| 1416 } | 1416 } |
| 1417 } | 1417 } |
| 1418 '''); | 1418 '''); |
| 1419 } | 1419 } |
| (...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3949 void _addMetaLibrary() { | 3949 void _addMetaLibrary() { |
| 3950 addFile(r''' | 3950 addFile(r''' |
| 3951 library meta; | 3951 library meta; |
| 3952 class _Checked { const _Checked(); } | 3952 class _Checked { const _Checked(); } |
| 3953 const Object checked = const _Checked(); | 3953 const Object checked = const _Checked(); |
| 3954 | 3954 |
| 3955 class _Virtual { const _Virtual(); } | 3955 class _Virtual { const _Virtual(); } |
| 3956 const Object virtual = const _Virtual(); | 3956 const Object virtual = const _Virtual(); |
| 3957 ''', name: '/meta.dart'); | 3957 ''', name: '/meta.dart'); |
| 3958 } | 3958 } |
| OLD | NEW |