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

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

Issue 2306223002: Move more error detection out of Scope (Closed)
Patch Set: clean-up Created 4 years, 3 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/compile_time_error_code_test.dart
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 3f7ac4ec83bd28b514ef310202a7e8aa09b947af..f506339294f0238d2b175fb48cd34fed394a534b 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -5675,6 +5675,28 @@ main() {
assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
}
+ void test_referencedBeforeDeclaration_type_localFunction() {
+ Source source = addSource(r'''
+void testTypeRef() {
+ String s = '';
+ int String(int x) => x + 1;
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+ }
+
+ void test_referencedBeforeDeclaration_type_localVariable() {
+ Source source = addSource(r'''
+void testTypeRef() {
+ String s = '';
+ var String = '';
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION]);
+ }
+
void test_rethrowOutsideCatch() {
Source source = addSource(r'''
f() {

Powered by Google App Engine
This is Rietveld 408576698