38 lines
1.8 KiB
Text
38 lines
1.8 KiB
Text
=== tests/cases/compiler/augmentedTypeBracketNamedPropertyAccess.ts ===
|
|
interface Object {
|
|
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 0))
|
|
|
|
data: number;
|
|
>data : Symbol(data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18))
|
|
}
|
|
interface Function {
|
|
>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(augmentedTypeBracketNamedPropertyAccess.ts, 2, 1))
|
|
|
|
functionData: string;
|
|
>functionData : Symbol(functionData, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 3, 20))
|
|
}
|
|
var o = {};
|
|
>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3))
|
|
|
|
var f = function () { };
|
|
>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3))
|
|
|
|
var r1 = o['data']; // Should be number
|
|
>r1 : Symbol(r1, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 9, 3))
|
|
>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3))
|
|
>'data' : Symbol(Object.data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18))
|
|
|
|
var r2 = o['functionData']; // Should be any (no property found)
|
|
>r2 : Symbol(r2, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 10, 3))
|
|
>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3))
|
|
|
|
var r3 = f['functionData']; // Should be string
|
|
>r3 : Symbol(r3, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 11, 3))
|
|
>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3))
|
|
>'functionData' : Symbol(Function.functionData, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 3, 20))
|
|
|
|
var r4 = f['data']; // Should be number
|
|
>r4 : Symbol(r4, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 12, 3))
|
|
>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3))
|
|
>'data' : Symbol(Object.data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18))
|
|
|