2015-02-03 02:36:45 +01:00
|
|
|
//// [computedPropertyNames48_ES6.ts]
|
2015-01-22 02:01:42 +01:00
|
|
|
declare function extractIndexer<T>(p: { [n: number]: T }): T;
|
|
|
|
|
|
|
|
enum E { x }
|
|
|
|
|
|
|
|
var a: any;
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
[a]: ""
|
|
|
|
}); // Should return string
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
[E.x]: ""
|
|
|
|
}); // Should return string
|
|
|
|
|
|
|
|
extractIndexer({
|
|
|
|
["" || 0]: ""
|
|
|
|
}); // Should return any (widened form of undefined)
|
|
|
|
|
2015-02-03 02:36:45 +01:00
|
|
|
//// [computedPropertyNames48_ES6.js]
|
2015-01-22 02:01:42 +01:00
|
|
|
var E;
|
|
|
|
(function (E) {
|
|
|
|
E[E["x"] = 0] = "x";
|
|
|
|
})(E || (E = {}));
|
|
|
|
var a;
|
|
|
|
extractIndexer({
|
|
|
|
[a]: ""
|
|
|
|
}); // Should return string
|
|
|
|
extractIndexer({
|
2015-03-04 17:17:18 +01:00
|
|
|
[E.x]: ""
|
2015-01-22 02:01:42 +01:00
|
|
|
}); // Should return string
|
|
|
|
extractIndexer({
|
|
|
|
["" || 0]: ""
|
|
|
|
}); // Should return any (widened form of undefined)
|