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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 1967583002: Check bounds of type parameters of function type aliases. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/generated/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index e458070aaf457ab7e31cce97d784b3d1b720ae9c..41a5185698042beccfc29c216f930ff37a291fed 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -5112,6 +5112,30 @@ f() { return new G<B>(); }''');
verify([source]);
}
+ void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound() {
+ Source source = addSource(r'''
+class A {}
+class B extends A {}
+typedef F<T extends A>();
+F<A> fa;
+F<B> fb;
+''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_noBound() {
+ Source source = addSource(r'''
+typedef F<T>();
+F<int> f1;
+F<String> f2;
+''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_typeArgumentNotMatchingBounds_typeArgumentList_0() {
Source source = addSource("abstract class A<T extends A>{}");
computeLibrarySourceErrors(source);

Powered by Google App Engine
This is Rietveld 408576698