class Result<T> {
constructor(public wasSuccessful: boolean, public error: T) {
}
public clone(): Result<T> {
...
}
}
let r1 = new Result(false, 'error: 42'); // Compiler infers T to string
let r2 = new Result(false, 42); // Compiler infers T...