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

Side by Side Diff: tests/language/function_subtype_typearg1_test.dart

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 years, 6 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
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 // Dart test program for constructors and initializers.
4 5
5 // Test that a class with a [call] property does not implement [Function] or 6 // Check function subtyping of type arguments.
6 // a typedef of function type.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 class Call { 10 class C<T> {}
11 int get call => 0;
12 }
13 11
14 typedef void F(); 12 class I {}
13 class J extends I {}
14
15 typedef void f1(C<J> c);
16 typedef void f2(C<I> c);
15 17
16 main() { 18 main() {
17 Expect.isFalse(new Call() is Function); 19 Expect.isTrue(new C<f2>() is C<f1>);
18 Expect.isFalse(new Call() is F);
19 } 20 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698