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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index ddf18db453405fcaad17dbdd9acc0b14dd2dabb0..82d8ca4a23263f07e699da84090d6c4bcee397ba 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -592,9 +592,11 @@ class C2 implements A, B {
void test_constructors_downwardsWithConstraint() {
// Regression test for https://github.com/dart-lang/sdk/issues/26431
checkFile(r'''
-class Foo<T extends Iterable> {}
+class A {}
+class B extends A {}
+class Foo<T extends A> {}
void main() {
- Foo<List> foo = /*info:INFERRED_TYPE_ALLOCATION*/new Foo();
+ Foo<B> foo = /*info:INFERRED_TYPE_ALLOCATION*/new Foo();
}
''');
}
@@ -4277,7 +4279,7 @@ main() {
void test_instantiateToBounds_generic2_hasBound_definedAfter() {
var unit = checkFile(r'''
-class B<T extends A> {}
+class B<T extends /*error:NOT_INSTANTIATED_BOUND*/A> {}
class A<T extends int> {}
B v = null;
''');
@@ -4287,7 +4289,7 @@ B v = null;
void test_instantiateToBounds_generic2_hasBound_definedBefore() {
var unit = checkFile(r'''
class A<T extends int> {}
-class B<T extends A> {}
+class B<T extends /*error:NOT_INSTANTIATED_BOUND*/A> {}
B v = null;
''');
expect(unit.topLevelVariables[0].type.toString(), 'B<A<dynamic>>');
@@ -4296,7 +4298,7 @@ B v = null;
void test_instantiateToBounds_generic2_noBound() {
var unit = checkFile(r'''
class A<T> {}
-class B<T extends A> {}
+class B<T extends /*error:NOT_INSTANTIATED_BOUND*/A> {}
B v = null;
''');
expect(unit.topLevelVariables[0].type.toString(), 'B<A<dynamic>>');

Powered by Google App Engine
This is Rietveld 408576698