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

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: remove comment 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
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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 C c = new C(); 1399 C c = new C();
1400 { 1400 {
1401 Function2<B, A> f; 1401 Function2<B, A> f;
1402 f = c.top; 1402 f = c.top;
1403 f = c.left; 1403 f = c.left;
1404 f = c.right; 1404 f = c.right;
1405 f = c.bot; 1405 f = c.bot;
1406 } 1406 }
1407 { 1407 {
1408 Function2<B, B> f; 1408 Function2<B, B> f;
1409 f = /*warning:DOWN_CAST_COMPOSITE*/c.top; 1409 f = /*error:STATIC_TYPE_ERROR*/c.top;
Leaf 2016/08/05 23:33:05 This doesn't feel right. I think this is the "stu
1410 f = c.left; 1410 f = c.left;
1411 f = /*warning:DOWN_CAST_COMPOSITE*/c.right; 1411 f = /*error:STATIC_TYPE_ERROR*/c.right;
1412 f = c.bot; 1412 f = c.bot;
1413 } 1413 }
1414 { 1414 {
1415 Function2<A, A> f; 1415 Function2<A, A> f;
1416 f = /*warning:DOWN_CAST_COMPOSITE*/c.top; 1416 f = /*error:STATIC_TYPE_ERROR*/c.top;
1417 f = /*warning:DOWN_CAST_COMPOSITE*/c.left; 1417 f = /*error:STATIC_TYPE_ERROR*/c.left;
1418 f = c.right; 1418 f = c.right;
1419 f = c.bot; 1419 f = c.bot;
1420 } 1420 }
1421 { 1421 {
1422 Function2<A, B> f; 1422 Function2<A, B> f;
1423 f = /*warning:DOWN_CAST_COMPOSITE*/c.top; 1423 f = /*error:STATIC_TYPE_ERROR*/c.top;
1424 f = /*warning:DOWN_CAST_COMPOSITE*/c.left; 1424 f = /*error:STATIC_TYPE_ERROR*/c.left;
1425 f = /*warning:DOWN_CAST_COMPOSITE*/c.right; 1425 f = /*error:STATIC_TYPE_ERROR*/c.right;
1426 f = c.bot; 1426 f = c.bot;
1427 } 1427 }
1428 } 1428 }
1429 '''); 1429 ''');
1430 } 1430 }
1431 1431
1432 void test_functionTypingAndSubtyping_intAndObject() { 1432 void test_functionTypingAndSubtyping_intAndObject() {
1433 checkFile(''' 1433 checkFile('''
1434 typedef Object Top(int x); // Top of the lattice 1434 typedef Object Top(int x); // Top of the lattice
1435 typedef int Left(int x); // Left branch 1435 typedef int Left(int x); // Left branch
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 // Regression test for https://github.com/dart-lang/sdk/issues/25069 3648 // Regression test for https://github.com/dart-lang/sdk/issues/25069
3649 checkFile(''' 3649 checkFile('''
3650 typedef int Foo(); 3650 typedef int Foo();
3651 void foo() {} 3651 void foo() {}
3652 void main () { 3652 void main () {
3653 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); 3653 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo();
3654 } 3654 }
3655 '''); 3655 ''');
3656 } 3656 }
3657 } 3657 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.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