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

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

Issue 2641213002: Issue 28100. In strong mode verify that TypeParameter bound has required type arguments. (Closed)
Patch Set: Created 3 years, 11 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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 // function expressions 2374 // function expressions
2375 var fe0 = (int x) => x as dynamic; 2375 var fe0 = (int x) => x as dynamic;
2376 var fe1 = (int x) => x; 2376 var fe1 = (int x) => x;
2377 '''); 2377 ''');
2378 check(implicitDynamic: false); 2378 check(implicitDynamic: false);
2379 } 2379 }
2380 2380
2381 void test_implicitDynamic_type() { 2381 void test_implicitDynamic_type() {
2382 addFile(r''' 2382 addFile(r'''
2383 class C<T> {} 2383 class C<T> {}
2384 class M1<T extends /*error:IMPLICIT_DYNAMIC_TYPE*/List> {} 2384 class M1<T extends /*error:IMPLICIT_DYNAMIC_TYPE*//*error:NOT_INSTANTIATED_BOUND */List> {}
2385 class M2<T> {} 2385 class M2<T> {}
2386 class I<T> {} 2386 class I<T> {}
2387 class D<T, S> extends /*error:IMPLICIT_DYNAMIC_TYPE*/C 2387 class D<T, S> extends /*error:IMPLICIT_DYNAMIC_TYPE*/C
2388 with M1, /*error:IMPLICIT_DYNAMIC_TYPE*/M2 2388 with M1, /*error:IMPLICIT_DYNAMIC_TYPE*/M2
2389 implements /*error:IMPLICIT_DYNAMIC_TYPE*/I {} 2389 implements /*error:IMPLICIT_DYNAMIC_TYPE*/I {}
2390 2390
2391 C f(D d) { 2391 C f(D d) {
2392 D x = new /*error:IMPLICIT_DYNAMIC_TYPE*/D(); 2392 D x = new /*error:IMPLICIT_DYNAMIC_TYPE*/D();
2393 D<int, dynamic> y = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D(); 2393 D<int, dynamic> y = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D();
2394 D<dynamic, int> z = /*info:INFERRED_TYPE_ALLOCATION*/new /*error:IMPLICIT_DYNA MIC_TYPE*/D(); 2394 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
4027 // Regression test for https://github.com/dart-lang/sdk/issues/25069 4027 // Regression test for https://github.com/dart-lang/sdk/issues/25069
4028 checkFile(''' 4028 checkFile('''
4029 typedef int Foo(); 4029 typedef int Foo();
4030 void foo() {} 4030 void foo() {}
4031 void main () { 4031 void main () {
4032 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); 4032 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo();
4033 } 4033 }
4034 '''); 4034 ''');
4035 } 4035 }
4036 } 4036 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698