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

Unified Diff: tests/language/src/FunctionTypeAliasTest.dart

Issue 9049016: in dartc, generics in Typedef not working as expected, when extending generic type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged up to r3100 Created 8 years, 11 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
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/FunctionTypeAliasTest.dart
diff --git a/tests/language/src/FunctionTypeAliasTest.dart b/tests/language/src/FunctionTypeAliasTest.dart
index f24fdda73769a36fcf1158d8a6e496f913a2dadf..3029e44d28a686358b0be3339338d3fcc67425da 100644
--- a/tests/language/src/FunctionTypeAliasTest.dart
+++ b/tests/language/src/FunctionTypeAliasTest.dart
@@ -24,12 +24,14 @@ typedef ParametrizedFun1<T, U extends bool, V>(T t, U u);
typedef List<T> ParametrizedFun2<T, U, V extends Map<T, int>>(
Map<T, int> t, U u);
+typedef void BoundsCheck<T extends num>(T arg);
+
class FunctionTypeAliasTest {
FunctionTypeAliasTest() {}
static int test(CompareObj compare, Object a, Object b) {
return compare(a, b);
}
- foo(Test test) {}
+ foo(Test arg) {}
static bar() {
FunctionTypeAliasTest a = new FunctionTypeAliasTest();
a.foo(() { });
@@ -93,6 +95,11 @@ class FunctionTypeAliasTest {
Expect.isTrue(plus is !CompareString);
Expect.equals(0, bar());
+
+ Function boundsTrue = void _(int arg) { };
+ Function boundsFalse = void _(String arg) { };
+ Expect.isTrue(boundsTrue is BoundsCheck<num>);
+ Expect.isFalse(boundsFalse is BoundsCheck<num>);
}
}
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698