mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Adding test
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
interface Computed<T> {
|
||||
read(): T;
|
||||
write(value: T);
|
||||
}
|
||||
|
||||
function foo<T>(x: Computed<T>) { }
|
||||
|
||||
var s: string;
|
||||
|
||||
// Calls below should infer string for T and then assign that type to the value parameter
|
||||
foo({
|
||||
read: () => s,
|
||||
write: value => s = value
|
||||
});
|
||||
foo({
|
||||
write: value => s = value,
|
||||
read: () => s
|
||||
});
|
||||
Reference in New Issue
Block a user