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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_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
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 cf549d8cde2a96a1a52d7a3b6363c31c2d27e937..9974fc69836bc2737c9ea49a9c117d9c2bd151d8 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -237,6 +237,40 @@ f(A a) {
verify([source]);
}
+ void test_assignability_function_expr_rettype_from_typedef_cls() {
+ // In the code below, the type of (() => f()) has a return type which is
+ // a class, and that class is inferred from the return type of the typedef
+ // F.
+ Source source = addSource('''
+class C {}
+typedef C F();
+F f;
+main() {
+ F f2 = (() => f());
+}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_assignability_function_expr_rettype_from_typedef_typedef() {
+ // In the code below, the type of (() => f()) has a return type which is
+ // a typedef, and that typedef is inferred from the return type of the
+ // typedef F.
+ Source source = addSource('''
+typedef G F();
+typedef G();
+F f;
+main() {
+ F f2 = (() => f());
+}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_assignmentToFinal_prefixNegate() {
Source source = addSource(r'''
f() {
« no previous file with comments | « pkg/analyzer/test/generated/element_test.dart ('k') | pkg/analyzer/test/generated/static_type_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698