Open
Description
TypeScript Version: 2.3.0
https://www.typescriptlang.org/play/
Code
class Greeter<T, S> {
greeting: T;
constructor(message: T, message2: S) {
this.greeting = message;
}
}
let greeter = new Greeter<string>("Hello", "world");
Expected behavior:
The compiler should infer S
to be string
.
Actual behavior:
Error:
Supplied parameters do not match any signature of call target.
The compiler expects either all generic parameters to be specified explicitly or none at all.