blob: 752287bd64145880211815fc182460befa2b67d5 [file] [log] [blame]
// Copyright (c) 2019, 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.
// @dart=2.9
/*@testedFeatures=inference*/
T map<T>(T Function() f1, T Function() f2) {}
id<T>(T t) => t;
Null foo() => null;
main() {
/*@ typeArgs=Null */ map(/*@ returnType=Null */ () {},
/*@ returnType=Null */ () => throw "hello");
/*@ typeArgs=Null */ map(/*@ returnType=Null */ () => throw "hello",
/*@ returnType=Null */ () {});
Null Function() f = /*@ returnType=Null */ () {};
/*@ typeArgs=Null */ map(
foo, /*@ returnType=Null */ () => throw "hello");
/*@ typeArgs=Null */ map(
/*@ returnType=Null */ () => throw "hello", foo);
/*@ typeArgs=Null */ map(/*@ returnType=Null */ () {
return null;
}, /*@ returnType=Null */ () => throw "hello");
/*@ typeArgs=Null */ map(/*@ returnType=Null */ () => throw "hello",
/*@ returnType=Null */ () {
return null;
});
/*@ typeArgs=() ->* Null */ id(/*@ returnType=Null */ () {});
}