blob: 8a89e247f6769a09be277bd23a1fb178b96201a9 [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.
/*@testedFeatures=inference*/
T map<T>(T Function() f1, T Function() f2) => throw '';
id<T>(T t) => t;
Null foo() => null;
test() {
/*@ typeArgs=Null */ map(
/*@ returnType=Null */ () {}, /*@returnType=Never*/ () => throw "hello");
/*@ typeArgs=Null */ map(
/*@returnType=Never*/ () => throw "hello", /*@ returnType=Null */ () {});
Null Function() f = /*@ returnType=Null */ () {};
/*@ typeArgs=Null */ map(foo, /*@returnType=Never*/ () => throw "hello");
/*@ typeArgs=Null */ map(/*@returnType=Never*/ () => throw "hello", foo);
/*@ typeArgs=Null */ map(/*@ returnType=Null */ () {
return null;
}, /*@returnType=Never*/ () => throw "hello");
/*@ typeArgs=Null */ map(/*@returnType=Never*/ () => throw "hello",
/*@ returnType=Null */ () {
return null;
});
/*@typeArgs=() -> Null*/ id(/*@ returnType=Null */ () {});
}
main() {}