1 // Copyright (c) 2017, 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 // Tests of generic functions.
6
7 import 'package:expect/expect.dart';
8
9 typedef R Foo<R>();
10
11 bar<R>(int body()) {
12 var function = () {
13 if (body is Foo<R>) {
14 return body();
15 }
16 return 42;
17 };
18 return function();
19 }
20
21 main(args) {
22 Expect.isTrue(bar(() => 43) == 43);
23 }
OLD
NEW
« no previous file with comments
|
« no previous file
|
no next file »
|
no next file with comments »
Issue 2881533002: Add a test requiring Kernel's Erasure pass
(Closed)
Created 3 years, 7 months ago by Kevin Millikin (Google)
Modified 3 years, 7 months ago
Reviewers: jensj
Base URL:
Comments: 0