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

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

Issue 1186033004: Update analyzer to reflect new rules for prefixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/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 05a6b993f09d345bfa5f60f11a7844aefed567d9..f35d057a9d0cb042e3adb4f69cf0f48b4ecfb2e5 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -54,47 +54,6 @@ f() {}''');
assertErrors(source, [StaticWarningCode.AMBIGUOUS_IMPORT]);
}
- void test_assignment_to_prefix_in_method() {
- // If p is an import prefix, then within a method body, p = expr should be
- // considered equivalent to this.p = expr.
- addNamedSource("/lib.dart", r'''
-library lib;
-''');
- Source source = addSource(r'''
-import 'lib.dart' as p;
-class C {
- f() {
- p = 0;
- }
-}
-''');
- computeLibrarySourceErrors(source);
- assertErrors(source, [
- StaticWarningCode.UNDEFINED_IDENTIFIER,
- HintCode.UNUSED_IMPORT
- ]);
- }
-
- void test_assignment_to_prefix_not_in_method() {
- // If p is an import prefix, then outside a method body, p = expr should be
- // considered equivalent to this.p = expr (and hence should result in a
- // static warning).
- addNamedSource("/lib.dart", r'''
-library lib;
-''');
- Source source = addSource(r'''
-import 'lib.dart' as p;
-f() {
- p = 0;
-}
-''');
- computeLibrarySourceErrors(source);
- assertErrors(source, [
- StaticWarningCode.UNDEFINED_IDENTIFIER,
- HintCode.UNUSED_IMPORT
- ]);
- }
-
void test_await_flattened() {
Source source = addSource('''
import 'dart:async';
@@ -1352,15 +1311,6 @@ void f() {
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_FUNCTION]);
}
- void test_undefinedFunction_hasImportPrefix() {
- Source source = addSource(r'''
-import 'lib.dart' as f;
-main() { return f(); }''');
- addNamedSource("/lib.dart", "library lib;");
- computeLibrarySourceErrors(source);
- assertErrors(source, [StaticTypeWarningCode.UNDEFINED_FUNCTION]);
- }
-
void test_undefinedFunction_inCatch() {
Source source = addSource(r'''
void f() {
@@ -1818,46 +1768,6 @@ class B extends A {
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SUPER_SETTER]);
}
- void test_unqualified_invocation_of_prefix_in_method() {
- // If p is an import prefix, then within a method body, p() should be
- // considered equivalent to this.p().
- addNamedSource("/lib.dart", r'''
-library lib;
-''');
- Source source = addSource(r'''
-import 'lib.dart' as p;
-class C {
- f() {
- p();
- }
-}
-''');
- computeLibrarySourceErrors(source);
- assertErrors(source, [
- StaticTypeWarningCode.UNDEFINED_METHOD,
- HintCode.UNUSED_IMPORT
- ]);
- verify([source]);
- }
-
- void test_unqualified_invocation_of_prefix_not_in_method() {
- // If p is an import prefix, then outside a method body, p() should be
- // considered equivalent to this.p() (and hence should result in a static
- // warning).
- addNamedSource("/lib.dart", r'''
-library lib;
-''');
- Source source = addSource(r'''
-import 'lib.dart' as p;
-f() {
- p();
-}
-''');
- computeLibrarySourceErrors(source);
- assertErrors(source, [StaticTypeWarningCode.UNDEFINED_FUNCTION]);
- verify([source]);
- }
-
void test_unqualifiedReferenceToNonLocalStaticMember_getter() {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | tests/language/illegal_invocation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698