// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'package:expect/expect.dart'; void foo(F f(F f)) {} B bar(B g(F f)) => null; Function baz() { B foo(B b, F f) => null; return foo; } class C { void foo(F f(T t, F f)) => null; B bar(B g(T t, F f)) => null; Function baz() { B foo(T t, F f) => null; return foo; } } main() { // Check the run-time type of the functions with generic parameters. Expect.type(X))>(foo); Expect.isTrue(bar is X1 Function(X1 Function(X2))); Expect.isTrue(baz() is int Function(int, X1)); Expect.isTrue(baz() is Object Function(Object, X1)); Expect.isTrue(baz() is Null Function(Null, X1)); void testC() { var c = new C(); Expect.type(T, F))>(c.foo); Expect.isTrue(c.bar is X1 Function(X1 Function(T, X2))); Expect.isTrue(c.baz() is int Function(T, X1)); } testC(); testC(); testC(); }