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

Side by Side Diff: tests/lib/mirrors/generics_substitution_test.dart

Issue 95123002: Substitute type variables as type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.generics_substitution; 5 library test.generics_substitution;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 class SuperGeneric<R, S> { 10 class SuperGeneric<R, S> {
(...skipping 18 matching lines...) Expand all
29 Expect.isFalse(superOfTAndInt.isOriginalDeclaration); 29 Expect.isFalse(superOfTAndInt.isOriginalDeclaration);
30 Expect.isFalse(superOfStringAndInt.isOriginalDeclaration); 30 Expect.isFalse(superOfStringAndInt.isOriginalDeclaration);
31 31
32 Symbol r(ClassMirror cm) => 32 Symbol r(ClassMirror cm) =>
33 (cm.declarations[#r] as VariableMirror).type.simpleName; 33 (cm.declarations[#r] as VariableMirror).type.simpleName;
34 Symbol s(ClassMirror cm) => 34 Symbol s(ClassMirror cm) =>
35 (cm.declarations[#s] as MethodMirror).parameters[0].type.simpleName; 35 (cm.declarations[#s] as MethodMirror).parameters[0].type.simpleName;
36 Symbol t(ClassMirror cm) => 36 Symbol t(ClassMirror cm) =>
37 (cm.declarations[#t] as MethodMirror).returnType.simpleName; 37 (cm.declarations[#t] as MethodMirror).returnType.simpleName;
38 38
39 Expect.equals(#T, r(genericDecl.superclass)); /// 01: ok 39 Expect.equals(#T, r(genericDecl.superclass));
40 Expect.equals(#int, s(genericDecl.superclass)); 40 Expect.equals(#int, s(genericDecl.superclass));
41 Expect.equals(#T, t(genericDecl)); 41 Expect.equals(#T, t(genericDecl));
42 42
43 Expect.equals(#String, r(genericOfString.superclass)); /// 01: ok 43 Expect.equals(#String, r(genericOfString.superclass));
44 Expect.equals(#int, s(genericOfString.superclass)); 44 Expect.equals(#int, s(genericOfString.superclass));
45 Expect.equals(#String, t(genericOfString)); 45 Expect.equals(#String, t(genericOfString));
46 46
47 Expect.equals(#R, r(superGenericDecl)); /// 01: ok 47 Expect.equals(#R, r(superGenericDecl));
48 Expect.equals(#S, s(superGenericDecl)); 48 Expect.equals(#S, s(superGenericDecl));
49 49
50 Expect.equals(#T, r(superOfTAndInt)); /// 01: ok 50 Expect.equals(#T, r(superOfTAndInt));
51 Expect.equals(#int, s(superOfTAndInt)); 51 Expect.equals(#int, s(superOfTAndInt));
52 52
53 Expect.equals(#String, r(superOfStringAndInt)); /// 01: ok 53 Expect.equals(#String, r(superOfStringAndInt));
54 Expect.equals(#int, s(superOfStringAndInt)); 54 Expect.equals(#int, s(superOfStringAndInt));
55 } 55 }
OLDNEW
« sdk/lib/_internal/lib/js_mirrors.dart ('K') | « tests/lib/mirrors/equality_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698