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

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

Issue 10545008: Eliminate internal compiler error when invoking a function type alias by mistake (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed unnecessary file. Created 8 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: 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 0b098429dacac23ff2600c6d7838d6f585224109..89860128c3698db3cb823aa0463752a859905fa1 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -1168,4 +1168,64 @@ public class ResolverTest extends ResolverTestCase {
errEx(ResolverErrorCode.FIELD_DOES_NOT_HAVE_A_SETTER, 17, 5, 7),
errEx(ResolverErrorCode.FIELD_DOES_NOT_HAVE_A_GETTER, 18, 14, 7));
}
+
+ public void testErrorInUnqualifiedInvocation1() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "class Foo {",
+ " Foo() {}",
+ "}",
+ "method() {",
+ " Foo();",
+ "}"),
+ errEx(ResolverErrorCode.DID_YOU_MEAN_NEW, 7, 2, 5));
+ }
+
+ public void testErrorInUnqualifiedInvocation2() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "class Foo {}",
+ "method() {",
+ " Foo();",
+ "}"),
+ errEx(ResolverErrorCode.DID_YOU_MEAN_NEW, 5, 2, 5));
+ }
+
+ public void testErrorInUnqualifiedInvocation3() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "class Foo<T> {",
+ " method() {",
+ " T();",
+ " }",
+ "}"),
+ errEx(ResolverErrorCode.DID_YOU_MEAN_NEW, 5, 4, 3));
+ }
+
+
+ public void testErrorInUnqualifiedInvocation4() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "typedef int foo();",
+ "method() {",
+ " foo();",
+ "}"),
+ errEx(ResolverErrorCode.CANNOT_CALL_FUNCTION_TYPE_ALIAS, 5, 2, 5));
+ }
+
+ public void testErrorInUnqualifiedInvocation5() {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "method() {",
+ " outer: for(int i = 0; i < 1; i++) {",
+ " outer();",
+ " }",
+ "}"),
+ errEx(ResolverErrorCode.CANNOT_RESOLVE_METHOD, 5, 5, 7));
+ }
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | tests/language/illegal_invocation_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698