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

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

Issue 10829288: Issue 3800. Calling an undefined constructor via new is a warning, not an error (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
index 9afac469af4a9575bed9d143b901288c6b4f156b..457910ade492dad99b8d84ee759cdf8ef4679784 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -448,7 +448,7 @@ public class ResolverTest extends ResolverTestCase {
"class B<T> {",
" factory A() { return new C<K>();}",
"}"),
- ResolverErrorCode.NO_SUCH_TYPE);
+ TypeErrorCode.NO_SUCH_TYPE);
}
public void testFactoryBadTypeArgs2() {
@@ -724,7 +724,7 @@ public class ResolverTest extends ResolverTestCase {
" var Bar;",
" create() { return new Bar();}",
"}"),
- ResolverErrorCode.NOT_A_TYPE);
+ TypeErrorCode.NOT_A_TYPE);
}
public void testNewExpression4() {
@@ -747,7 +747,7 @@ public class ResolverTest extends ResolverTestCase {
"class B {",
" foo() { return new Foo<T>(); }",
"}"),
- ResolverErrorCode.NO_SUCH_TYPE);
+ TypeErrorCode.NO_SUCH_TYPE);
}
public void testNewExpression6() {
@@ -1038,7 +1038,7 @@ public class ResolverTest extends ResolverTestCase {
" new Unknown();",
" }",
"}"),
- ResolverErrorCode.NO_SUCH_TYPE);
+ TypeErrorCode.NO_SUCH_TYPE);
}
public void test_new_noSuchType_typeArgument() throws Exception {
@@ -1050,7 +1050,7 @@ public class ResolverTest extends ResolverTestCase {
" new Foo<T>();",
" }",
"}"),
- ResolverErrorCode.NO_SUCH_TYPE);
+ TypeErrorCode.NO_SUCH_TYPE);
}
public void test_new_wrongTypeArgumentsNumber() throws Exception {
@@ -1193,7 +1193,7 @@ public class ResolverTest extends ResolverTestCase {
" }",
"}"),
ResolverErrorCode.DUPLICATE_LOCAL_VARIABLE_WARNING,
- ResolverErrorCode.NOT_A_TYPE);
+ TypeErrorCode.NOT_A_TYPE);
}
public void test_operatorIs_withFunctionAlias() throws Exception {
@@ -1217,8 +1217,16 @@ public class ResolverTest extends ResolverTestCase {
" static foo() { new T(); }", // can't ref type variable in method
" static bar() { T variable = 1; }",
"}"),
- ResolverErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
- TypeErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT);
+ errEx(TypeErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT, 3, 22 , 1),
+ errEx(TypeErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT, 4, 18, 1));
+// resolveAndTest(Joiner.on("\n").join(
Brian Wilkerson 2012/08/10 20:59:07 Delete the commented out code?
+// "class Object {}",
+// "class A<T> {",
+// " static foo() { new T(); }", // can't ref type variable in method
+// " static bar() { T variable = 1; }",
+// "}"),
+// ResolverErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
+// TypeErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT);
}
public void testTypeVariableShadowsClass() {

Powered by Google App Engine
This is Rietveld 408576698