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

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

Issue 2658303002: Relax type bound restrictions slightly, apply to typedefs. (Closed)
Patch Set: Typing fix Created 3 years, 10 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 '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 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 // function expressions 2420 // function expressions
2421 var fe0 = (int x) => x as dynamic; 2421 var fe0 = (int x) => x as dynamic;
2422 var fe1 = (int x) => x; 2422 var fe1 = (int x) => x;
2423 '''); 2423 ''');
2424 check(implicitDynamic: false); 2424 check(implicitDynamic: false);
2425 } 2425 }
2426 2426
2427 void test_implicitDynamic_type() { 2427 void test_implicitDynamic_type() {
2428 addFile(r''' 2428 addFile(r'''
2429 class C<T> {} 2429 class C<T> {}
2430 class M1<T extends /*error:IMPLICIT_DYNAMIC_TYPE*//*error:NOT_INSTANTIATED_BOUND */List> {} 2430 class M1<T extends /*error:IMPLICIT_DYNAMIC_TYPE*/List> {}
2431 class M2<T> {} 2431 class M2<T> {}
2432 class I<T> {} 2432 class I<T> {}
2433 class D<T, S> extends /*error:IMPLICIT_DYNAMIC_TYPE*/C 2433 class D<T, S> extends /*error:IMPLICIT_DYNAMIC_TYPE*/C
2434 with M1, /*error:IMPLICIT_DYNAMIC_TYPE*/M2 2434 with M1, /*error:IMPLICIT_DYNAMIC_TYPE*/M2
2435 implements /*error:IMPLICIT_DYNAMIC_TYPE*/I {} 2435 implements /*error:IMPLICIT_DYNAMIC_TYPE*/I {}
2436 2436
2437 C f(D d) { 2437 C f(D d) {
2438 D x = new /*error:IMPLICIT_DYNAMIC_TYPE*/D(); 2438 D x = new /*error:IMPLICIT_DYNAMIC_TYPE*/D();
2439 D<int, dynamic> y = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D(); 2439 D<int, dynamic> y = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D();
2440 D<dynamic, int> z = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D(); 2440 D<dynamic, int> z = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D();
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
4073 // Regression test for https://github.com/dart-lang/sdk/issues/25069 4073 // Regression test for https://github.com/dart-lang/sdk/issues/25069
4074 checkFile(''' 4074 checkFile('''
4075 typedef int Foo(); 4075 typedef int Foo();
4076 void foo() {} 4076 void foo() {}
4077 void main () { 4077 void main () {
4078 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); 4078 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo();
4079 } 4079 }
4080 '''); 4080 ''');
4081 } 4081 }
4082 } 4082 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698