2015-02-03 02:36:45 +01:00
|
|
|
//// [computedPropertyNamesContextualType2_ES6.ts]
|
2015-01-14 21:09:46 +01:00
|
|
|
interface I {
|
|
|
|
[s: string]: (x: any) => number; // Doesn't get hit
|
|
|
|
[s: number]: (x: string) => number;
|
|
|
|
}
|
|
|
|
|
|
|
|
var o: I = {
|
|
|
|
[+"foo"](y) { return y.length; },
|
|
|
|
[+"bar"]: y => y.length
|
|
|
|
}
|
|
|
|
|
2015-02-03 02:36:45 +01:00
|
|
|
//// [computedPropertyNamesContextualType2_ES6.js]
|
2015-01-14 21:09:46 +01:00
|
|
|
var o = {
|
2015-02-07 05:03:24 +01:00
|
|
|
[+"foo"](y) { return y.length; },
|
2015-02-22 02:16:04 +01:00
|
|
|
[+"bar"]: y => y.length
|
2015-01-14 21:09:46 +01:00
|
|
|
};
|