2014-07-13 01:04:16 +02:00
|
|
|
//// [augmentedTypeBracketNamedPropertyAccess.ts]
|
|
|
|
interface Object {
|
|
|
|
data: number;
|
|
|
|
}
|
|
|
|
interface Function {
|
|
|
|
functionData: string;
|
|
|
|
}
|
|
|
|
var o = {};
|
|
|
|
var f = function () { };
|
|
|
|
|
|
|
|
var r1 = o['data']; // Should be number
|
|
|
|
var r2 = o['functionData']; // Should be any (no property found)
|
|
|
|
var r3 = f['functionData']; // Should be string
|
|
|
|
var r4 = f['data']; // Should be number
|
|
|
|
|
|
|
|
//// [augmentedTypeBracketNamedPropertyAccess.js]
|
|
|
|
var o = {};
|
|
|
|
var f = function () {
|
|
|
|
};
|
2014-08-15 22:18:54 +02:00
|
|
|
var r1 = o['data']; // Should be number
|
|
|
|
var r2 = o['functionData']; // Should be any (no property found)
|
|
|
|
var r3 = f['functionData']; // Should be string
|
2014-08-15 23:32:08 +02:00
|
|
|
var r4 = f['data']; // Should be number
|