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 33b976963652a1765af50daca70d7932486d3fc3..25ba9fa30c5b02fd9e2d603b780db347f33b88f7 100644 |
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart |
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart |
@@ -4933,6 +4933,21 @@ class Bar extends Foo { |
verify([source]); |
} |
+ void test_undefinedGetter_typeLiteral_conditionalAccess() { |
+ // When applied to a type literal, the conditional access operator '?.' can |
+ // be used to access instance getters of Type. |
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
+ options.enableNullAwareOperators = true; |
+ resetWithOptions(options); |
+ Source source = addSource(''' |
+class A {} |
+f() => A?.hashCode; |
+'''); |
+ resolve(source); |
+ assertNoErrors(source); |
+ verify([source]); |
+ } |
+ |
void test_undefinedGetter_typeSubstitution() { |
Source source = addSource(r''' |
class A<E> { |
@@ -5008,6 +5023,21 @@ main() { |
// A call to verify(source) fails as '(() => null)()' isn't resolved. |
} |
+ void test_undefinedMethod_typeLiteral_conditionalAccess() { |
+ // When applied to a type literal, the conditional access operator '?.' can |
+ // be used to access instance methods of Type. |
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
+ options.enableNullAwareOperators = true; |
+ resetWithOptions(options); |
+ Source source = addSource(''' |
+class A {} |
+f() => A?.toString(); |
+'''); |
+ resolve(source); |
+ assertNoErrors(source); |
+ verify([source]); |
+ } |
+ |
void test_undefinedOperator_index() { |
Source source = addSource(r''' |
class A { |