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

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

Issue 1143003007: Fix handling of nested typedefs (for real this time). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | tests/language/regress_21912_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/static_type_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index 0282d9965ed81c945565d83411f3f3e929cc9be8..8e5a303012818bf0bed39cb875dbb5cc0957ab6c 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -80,6 +80,35 @@ f() async {
verify([source]);
}
+ void test_bug21912() {
+ Source source = addSource('''
+class A {}
+class B extends A {}
+
+typedef T Function2<S, T>(S z);
+typedef B AToB(A x);
+typedef A BToA(B x);
+
+void main() {
+ {
+ Function2<Function2<A, B>, Function2<B, A>> t1;
+ Function2<AToB, BToA> t2;
+
+ Function2<Function2<int, double>, Function2<int, double>> left;
+
+ left = t1;
+ left = t2;
+ }
+}
+''');
+ resolve(source);
+ assertErrors(source, [
+ StaticTypeWarningCode.INVALID_ASSIGNMENT,
+ StaticTypeWarningCode.INVALID_ASSIGNMENT
+ ]);
+ verify([source]);
+ }
+
void test_expectedOneListTypeArgument() {
Source source = addSource(r'''
main() {
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | tests/language/regress_21912_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698