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

Side by Side Diff: pkg/kernel/testcases/reify/factories_test.dart

Issue 2697873007: Merge the work on Generic Types Reification from 'dart-lang/reify' repo (Closed)
Patch Set: Create and use common 'kernel/runtime' directory Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 factories_test;
6
7 import 'test_base.dart';
8
9 class A<T> {
10 factory A() {
11 return new B<T>();
12 }
13
14 factory A.named() {
15 return new A<T>.internal();
16 }
17
18 factory A.forward() = A<T>.internal;
19
20 A.internal();
21 }
22
23 class B<T> extends A<T> {
24 B() : super.internal();
25 }
26
27 class X {}
28
29 class Y {}
30
31 main() {
32 expectTrue(new A<X>.named() is A<X>);
33 expectTrue(new A<X>.named() is! A<Y>);
34 expectTrue(new A<X>.forward() is A<X>);
35 expectTrue(new A<X>.forward() is! A<Y>);
36 expectTrue(new A<X>() is B<X>);
37 expectTrue(new A<X>() is! B<Y>);
38 expectTrue(new A<X>.named() is! B<X>);
39 expectTrue(new A<X>.forward() is! B<X>);
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698