Adding test

This commit is contained in:
Anders Hejlsberg
2015-01-30 14:14:22 -08:00
parent c7e7bb12fe
commit 005676005f
3 changed files with 117 additions and 0 deletions

View File

@@ -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
});