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

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

Issue 128673003: Revert "Add ClassMirror.isAbstract to the API and VM implementation." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 library test.abstract_class_test;
6
7 import 'dart:mirrors';
8 import 'package:expect/expect.dart';
9
10 abstract class Foo {
11 foo();
12 }
13 class Bar extends Foo {
14 foo() {}
15 }
16
17 abstract class FunctionFoo implements Function {
18 call();
19 }
20 class FunctionBar extends FunctionFoo {
21 call() {}
22 }
23
24 abstract class GenericFoo<T> {
25 T genericFoo();
26 }
27 class GenericBar<T> extends GenericFoo<T> {
28 T genericFoo() {}
29 }
30
31 void main() {
32 // FunctionTypeMirror
33 baz() {}
34 Expect.isFalse(reflect(baz).type.isAbstract);
35
36 return; /// 01: ok
37
38 // Unbound ClassMirror
39 Expect.isTrue(reflectClass(Foo).isAbstract);
40 Expect.isFalse(reflectClass(Bar).isAbstract);
41 Expect.isTrue(reflect(new Bar()).type.superclass.isAbstract);
42 Expect.isFalse(reflect(new Bar()).type.isAbstract);
43
44 Expect.isTrue(reflectClass(FunctionFoo).isAbstract);
45 Expect.isFalse(reflectClass(FunctionBar).isAbstract);
46 Expect.isTrue(reflect(new FunctionBar()).type.superclass.isAbstract);
47 Expect.isFalse(reflect(new FunctionBar()).type.isAbstract);
48
49 Expect.isTrue(reflectClass(GenericFoo).isAbstract);
50 Expect.isFalse(reflectClass(GenericBar).isAbstract);
51
52 // Bound ClassMirror
53 Expect.isTrue(reflect(new GenericBar<int>()).type.superclass.isAbstract);
54 Expect.isFalse(reflect(new GenericBar<int>()).type.isAbstract);
55 }
OLDNEW
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698