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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 46663008: Issue 14524. Support for function type alias as a type literal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index eb212d7696a8ebd274401cb251b5326b7ada135f..bd7c686c4cca33ed1623bfd953503a4727222d0b 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -3281,6 +3281,60 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_typeType_class() throws Exception {
+ Source source = addSource(createSource(//
+ "class C {}",
+ "f(Type t) {}",
+ "main() {",
+ " f(C);",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_typeType_class_prefixed() throws Exception {
+ addSource("/lib.dart", createSource(//
+ "library lib;",
+ "class C {}"));
+ Source source = addSource(createSource(//
+ "import 'lib.dart' as p;",
+ "f(Type t) {}",
+ "main() {",
+ " f(p.C);",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_typeType_functionTypeAlias() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef F();",
+ "f(Type t) {}",
+ "main() {",
+ " f(F);",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_typeType_functionTypeAlias_prefixed() throws Exception {
+ addSource("/lib.dart", createSource(//
+ "library lib;",
+ "typedef F();"));
+ Source source = addSource(createSource(//
+ "import 'lib.dart' as p;",
+ "f(Type t) {}",
+ "main() {",
+ " f(p.F);",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_undefinedConstructorInInitializer_explicit_named() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698