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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java

Issue 10908103: Use of undefined class in const constructor should be an error (issue 4882) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java (revision 11901)
+++ compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java (working copy)
@@ -1365,6 +1365,15 @@
errEx(ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION, 3, 14, 12));
}
+ public void test_const_undefinedClass() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "main() {",
+ " const A();",
+ "}"),
+ errEx(TypeErrorCode.NO_SUCH_TYPE_CONST, 3, 8, 1));
+ }
+
public void testNoGetterOrSetter() {
resolveAndTest(Joiner.on("\n").join(
"class Object {}",

Powered by Google App Engine
This is Rietveld 408576698