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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 12045032: Issue 7980. Report problem when type 'dynamic' is shadowed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 0da5e8d488d02a531142b3db51c078a55b0f8b14..7834eaa12a8cf227e33077a42726154dd73ef4e4 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -3496,6 +3496,23 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
/**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=7980
+ */
+ public void test_whenVariableNamedDynamic() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " var dynamic = 42;",
+ " new List<dynamic>();",
+ "}",
+ "");
+ assertErrors(
+ libraryResult.getErrors(),
+ errEx(TypeErrorCode.NOT_A_TYPE, 4, 12, 7));
+ }
+
+ /**
* It is a static warning if the return type of the user-declared operator == is explicitly
* declared and not bool.
*/
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698