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

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

Issue 8774024: Parse method names that include type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Feedback from mmedendez Created 9 years 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 de744fc88f17e4308d54a5d3fd4784a23bfff152..800cd84ffd8482ac03ae74b6d71af0bd5260fd3b 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -344,6 +344,35 @@ public class ResolverTest extends ResolverTestCase {
"}"));
}
+ public void testFactoryTypeArgsNew() {
+ // Invoke constructor in factory method with type args
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "interface A<T> factory B {",
+ " A<T>();",
+ "}",
+ "class C<T> implements A<T> {}",
+ "class B {",
+ " factory A<T>() { return new C<T>();}",
+ "}"));
+ }
+
+ public void testFactoryBadTypeArgsNew() {
+ // Invoke constructor in factory method with (wrong) type args
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "interface A<T> factory B {",
+ " A<T>();",
+ "}",
+ "class C<T> implements A<T> {}",
+ "class B {",
+ " factory A<T>() { return new C<K>();}",
+ "}"),
+ ResolverErrorCode.NO_SUCH_TYPE);
+ }
+
public void disabledBadFactoryTypeArgs1() {
// Type arguments don't match
resolveAndTest(Joiner.on("\n").join(

Powered by Google App Engine
This is Rietveld 408576698