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

Unified Diff: pkg/analyzer/test/src/summary/linker_test.dart

Issue 2511753002: Fix crash while inferencing instance field type. (Closed)
Patch Set: Created 4 years, 1 month 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/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/linker_test.dart
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index 2a0706c880be4740492206342a238de8ba2cd721..cd70c5dac03aaaf0a7a4a2f8de82a2d6ce799972 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -351,6 +351,20 @@ var y = C.x;
'(D) → E');
}
+ void test_inferredType_instanceField_conditional_genericFunctions() {
+ createLinker('''
+class C {
+ final f = true ? <T>(T t) => 0 : <T>(T t) => 1;
+}
+''');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ library.libraryCycleForLink.ensureLinked();
+ ClassElementForLink_Class cls = library.getContainedName('C');
+ expect(cls.fields, hasLength(1));
+ var field = cls.fields[0];
+ expect(field.type.toString(), '(<bottom>) → dynamic');
+ }
+
void test_inferredType_instanceField_dynamic() {
createLinker('''
var x;
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698