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

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

Issue 1519583002: Issue 25218. The reference type of 'A' in 'A..foo' is 'Type'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/generated/element_resolver.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/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 e502906275cafa399ff113cb2b69bb7a0d5023c2..2c1e2d27c818dd146f32f6133187f1ceba5ab373 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -1122,7 +1122,8 @@ class A<T extends T> {
verify([source]);
}
- void test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_mutated() {
+ void
+ test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_mutated() {
Source source = addSource(r'''
callMe(f()) { f(); }
main(Object p) {
@@ -1151,7 +1152,8 @@ main(Object p) {
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
}
- void test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_after() {
+ void
+ test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_after() {
Source source = addSource(r'''
callMe(f()) { f(); }
main(Object p) {
@@ -1162,7 +1164,8 @@ main(Object p) {
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
}
- void test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_before() {
+ void
+ test_typePromotion_conditional_useInThen_accessedInClosure_hasAssignment_before() {
Source source = addSource(r'''
callMe(f()) { f(); }
main(Object p) {
@@ -1442,6 +1445,18 @@ var a = A.B;''');
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
}
+ void test_undefinedGetter_typeLiteral_cascadeTarget() {
+ Source source = addSource(r'''
+class T {
+ static int get foo => 42;
+}
+main() {
+ T..foo;
+}''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]);
+ }
+
void test_undefinedGetter_typeLiteral_conditionalAccess() {
// When applied to a type literal, the conditional access operator '?.'
// cannot be used to access instance getters of Type.
@@ -1613,6 +1628,19 @@ main() {
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_METHOD]);
}
+ void test_undefinedMethod_typeLiteral_cascadeTarget() {
+ Source source = addSource('''
+class T {
+ static void foo() {}
+}
+main() {
+ T..foo();
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_METHOD]);
+ }
+
void test_undefinedMethod_typeLiteral_conditionalAccess() {
// When applied to a type literal, the conditional access operator '?.'
// cannot be used to access instance methods of Type.
@@ -1713,6 +1741,18 @@ f() { A.B = 0;}''');
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SETTER]);
}
+ void test_undefinedSetter_typeLiteral_cascadeTarget() {
+ Source source = addSource(r'''
+class T {
+ static void set foo(_) {}
+}
+main() {
+ T..foo = 42;
+}''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SETTER]);
+ }
+
void test_undefinedSetter_void() {
Source source = addSource(r'''
class T {
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698