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

Unified Diff: tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart

Issue 968843003: Implement type argument access and reification of runtime types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unbreak long line. Created 5 years, 10 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 | « pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..86f8260867b999bb00e7cb50fcdcf5102d4424ec
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=-DUSE_CPS_IR=true
+
+// Tests for the runtime type implementation.
+
+library basic_tests;
+
+import 'js_backend_cps_ir.dart';
+
+const String getTypeArgument = r'H.getTypeArgumentByIndex';
+const String getSubstitutedTypeArgument = 'H.getRuntimeTypeArgument';
+const String typeToString = r'H.runtimeTypeToString';
+const String createType = r'H.createRuntimeType';
+
+const List<TestEntry> tests = const [
+ const TestEntry.forMethod("function(C#foo)",
+r"""
+class C<T> {
+ foo() => print(T);
+}
+
+main() {
+ new C<int>().foo();
+}""",
+"""
+function() {
+ return P.print($createType($typeToString($getTypeArgument(this, 0))));
+}"""),
+ const TestEntry.forMethod("function(C#foo)",
+r"""
+class C<T, U> {
+ foo() => print(U);
+}
+
+class D extends C<int, double> {}
+
+main() {
+ new D().foo();
+}""",
+"""
+function() {
+ return P.print($createType($typeToString($getSubstitutedTypeArgument(this, "\$asC", 1))));
+}"""),
+];
+
+void main() {
+ runTests(tests);
+}
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698