|
|
@ -16,562 +16,694 @@ class Shape {
|
|
|
|
>visible : Symbol(Shape.visible, Decl(keyofAndIndexedAccess.ts, 4, 19))
|
|
|
|
>visible : Symbol(Shape.visible, Decl(keyofAndIndexedAccess.ts, 4, 19))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TaggedShape extends Shape {
|
|
|
|
|
|
|
|
>TaggedShape : Symbol(TaggedShape, Decl(keyofAndIndexedAccess.ts, 6, 1))
|
|
|
|
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tag: string;
|
|
|
|
|
|
|
|
>tag : Symbol(TaggedShape.tag, Decl(keyofAndIndexedAccess.ts, 8, 33))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Item {
|
|
|
|
class Item {
|
|
|
|
>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 6, 1))
|
|
|
|
>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 10, 1))
|
|
|
|
|
|
|
|
|
|
|
|
name: string;
|
|
|
|
name: string;
|
|
|
|
>name : Symbol(Item.name, Decl(keyofAndIndexedAccess.ts, 8, 12))
|
|
|
|
>name : Symbol(Item.name, Decl(keyofAndIndexedAccess.ts, 12, 12))
|
|
|
|
|
|
|
|
|
|
|
|
price: number;
|
|
|
|
price: number;
|
|
|
|
>price : Symbol(Item.price, Decl(keyofAndIndexedAccess.ts, 9, 17))
|
|
|
|
>price : Symbol(Item.price, Decl(keyofAndIndexedAccess.ts, 13, 17))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Options {
|
|
|
|
class Options {
|
|
|
|
>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 11, 1))
|
|
|
|
>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
|
|
|
|
|
|
|
|
visible: "yes" | "no";
|
|
|
|
visible: "yes" | "no";
|
|
|
|
>visible : Symbol(Options.visible, Decl(keyofAndIndexedAccess.ts, 13, 15))
|
|
|
|
>visible : Symbol(Options.visible, Decl(keyofAndIndexedAccess.ts, 17, 15))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Dictionary<T> = { [x: string]: T };
|
|
|
|
type Dictionary<T> = { [x: string]: T };
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 17, 16))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 21, 16))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 17, 24))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 21, 24))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 17, 16))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 21, 16))
|
|
|
|
|
|
|
|
|
|
|
|
const enum E { A, B, C }
|
|
|
|
const enum E { A, B, C }
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
|
|
|
|
>A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 19, 14))
|
|
|
|
>A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 23, 14))
|
|
|
|
>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 19, 17))
|
|
|
|
>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17))
|
|
|
|
>C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 19, 20))
|
|
|
|
>C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 23, 20))
|
|
|
|
|
|
|
|
|
|
|
|
type K00 = keyof any; // string | number
|
|
|
|
type K00 = keyof any; // string | number
|
|
|
|
>K00 : Symbol(K00, Decl(keyofAndIndexedAccess.ts, 19, 24))
|
|
|
|
>K00 : Symbol(K00, Decl(keyofAndIndexedAccess.ts, 23, 24))
|
|
|
|
|
|
|
|
|
|
|
|
type K01 = keyof string; // number | "toString" | "charAt" | ...
|
|
|
|
type K01 = keyof string; // number | "toString" | "charAt" | ...
|
|
|
|
>K01 : Symbol(K01, Decl(keyofAndIndexedAccess.ts, 21, 21))
|
|
|
|
>K01 : Symbol(K01, Decl(keyofAndIndexedAccess.ts, 25, 21))
|
|
|
|
|
|
|
|
|
|
|
|
type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ...
|
|
|
|
type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ...
|
|
|
|
>K02 : Symbol(K02, Decl(keyofAndIndexedAccess.ts, 22, 24))
|
|
|
|
>K02 : Symbol(K02, Decl(keyofAndIndexedAccess.ts, 26, 24))
|
|
|
|
|
|
|
|
|
|
|
|
type K03 = keyof boolean; // "valueOf"
|
|
|
|
type K03 = keyof boolean; // "valueOf"
|
|
|
|
>K03 : Symbol(K03, Decl(keyofAndIndexedAccess.ts, 23, 24))
|
|
|
|
>K03 : Symbol(K03, Decl(keyofAndIndexedAccess.ts, 27, 24))
|
|
|
|
|
|
|
|
|
|
|
|
type K04 = keyof void; // never
|
|
|
|
type K04 = keyof void; // never
|
|
|
|
>K04 : Symbol(K04, Decl(keyofAndIndexedAccess.ts, 24, 25))
|
|
|
|
>K04 : Symbol(K04, Decl(keyofAndIndexedAccess.ts, 28, 25))
|
|
|
|
|
|
|
|
|
|
|
|
type K05 = keyof undefined; // never
|
|
|
|
type K05 = keyof undefined; // never
|
|
|
|
>K05 : Symbol(K05, Decl(keyofAndIndexedAccess.ts, 25, 22))
|
|
|
|
>K05 : Symbol(K05, Decl(keyofAndIndexedAccess.ts, 29, 22))
|
|
|
|
|
|
|
|
|
|
|
|
type K06 = keyof null; // never
|
|
|
|
type K06 = keyof null; // never
|
|
|
|
>K06 : Symbol(K06, Decl(keyofAndIndexedAccess.ts, 26, 27))
|
|
|
|
>K06 : Symbol(K06, Decl(keyofAndIndexedAccess.ts, 30, 27))
|
|
|
|
|
|
|
|
|
|
|
|
type K07 = keyof never; // never
|
|
|
|
type K07 = keyof never; // never
|
|
|
|
>K07 : Symbol(K07, Decl(keyofAndIndexedAccess.ts, 27, 22))
|
|
|
|
>K07 : Symbol(K07, Decl(keyofAndIndexedAccess.ts, 31, 22))
|
|
|
|
|
|
|
|
|
|
|
|
type K10 = keyof Shape; // "name" | "width" | "height" | "visible"
|
|
|
|
type K10 = keyof Shape; // "name" | "width" | "height" | "visible"
|
|
|
|
>K10 : Symbol(K10, Decl(keyofAndIndexedAccess.ts, 28, 23))
|
|
|
|
>K10 : Symbol(K10, Decl(keyofAndIndexedAccess.ts, 32, 23))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type K11 = keyof Shape[]; // number | "length" | "toString" | ...
|
|
|
|
type K11 = keyof Shape[]; // number | "length" | "toString" | ...
|
|
|
|
>K11 : Symbol(K11, Decl(keyofAndIndexedAccess.ts, 30, 23))
|
|
|
|
>K11 : Symbol(K11, Decl(keyofAndIndexedAccess.ts, 34, 23))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type K12 = keyof Dictionary<Shape>; // string | number
|
|
|
|
type K12 = keyof Dictionary<Shape>; // string | number
|
|
|
|
>K12 : Symbol(K12, Decl(keyofAndIndexedAccess.ts, 31, 25))
|
|
|
|
>K12 : Symbol(K12, Decl(keyofAndIndexedAccess.ts, 35, 25))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type K13 = keyof {}; // never
|
|
|
|
type K13 = keyof {}; // never
|
|
|
|
>K13 : Symbol(K13, Decl(keyofAndIndexedAccess.ts, 32, 35))
|
|
|
|
>K13 : Symbol(K13, Decl(keyofAndIndexedAccess.ts, 36, 35))
|
|
|
|
|
|
|
|
|
|
|
|
type K14 = keyof Object; // "constructor" | "toString" | ...
|
|
|
|
type K14 = keyof Object; // "constructor" | "toString" | ...
|
|
|
|
>K14 : Symbol(K14, Decl(keyofAndIndexedAccess.ts, 33, 20))
|
|
|
|
>K14 : Symbol(K14, Decl(keyofAndIndexedAccess.ts, 37, 20))
|
|
|
|
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
|
|
|
|
|
|
|
|
type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ...
|
|
|
|
type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ...
|
|
|
|
>K15 : Symbol(K15, Decl(keyofAndIndexedAccess.ts, 34, 24))
|
|
|
|
>K15 : Symbol(K15, Decl(keyofAndIndexedAccess.ts, 38, 24))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
|
|
|
|
|
|
|
|
|
|
|
|
type K16 = keyof [string, number]; // number | "0" | "1" | "length" | "toString" | ...
|
|
|
|
type K16 = keyof [string, number]; // number | "0" | "1" | "length" | "toString" | ...
|
|
|
|
>K16 : Symbol(K16, Decl(keyofAndIndexedAccess.ts, 35, 19))
|
|
|
|
>K16 : Symbol(K16, Decl(keyofAndIndexedAccess.ts, 39, 19))
|
|
|
|
|
|
|
|
|
|
|
|
type K17 = keyof (Shape | Item); // "name"
|
|
|
|
type K17 = keyof (Shape | Item); // "name"
|
|
|
|
>K17 : Symbol(K17, Decl(keyofAndIndexedAccess.ts, 36, 34))
|
|
|
|
>K17 : Symbol(K17, Decl(keyofAndIndexedAccess.ts, 40, 34))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 6, 1))
|
|
|
|
>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 10, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type K18 = keyof (Shape & Item); // "name" | "width" | "height" | "visible" | "price"
|
|
|
|
type K18 = keyof (Shape & Item); // "name" | "width" | "height" | "visible" | "price"
|
|
|
|
>K18 : Symbol(K18, Decl(keyofAndIndexedAccess.ts, 37, 32))
|
|
|
|
>K18 : Symbol(K18, Decl(keyofAndIndexedAccess.ts, 41, 32))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 6, 1))
|
|
|
|
>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 10, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type KeyOf<T> = keyof T;
|
|
|
|
type KeyOf<T> = keyof T;
|
|
|
|
>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 38, 32))
|
|
|
|
>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 42, 32))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 40, 11))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 44, 11))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 40, 11))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 44, 11))
|
|
|
|
|
|
|
|
|
|
|
|
type K20 = KeyOf<Shape>; // "name" | "width" | "height" | "visible"
|
|
|
|
type K20 = KeyOf<Shape>; // "name" | "width" | "height" | "visible"
|
|
|
|
>K20 : Symbol(K20, Decl(keyofAndIndexedAccess.ts, 40, 24))
|
|
|
|
>K20 : Symbol(K20, Decl(keyofAndIndexedAccess.ts, 44, 24))
|
|
|
|
>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 38, 32))
|
|
|
|
>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 42, 32))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type K21 = KeyOf<Dictionary<Shape>>; // string | number
|
|
|
|
type K21 = KeyOf<Dictionary<Shape>>; // string | number
|
|
|
|
>K21 : Symbol(K21, Decl(keyofAndIndexedAccess.ts, 42, 24))
|
|
|
|
>K21 : Symbol(K21, Decl(keyofAndIndexedAccess.ts, 46, 24))
|
|
|
|
>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 38, 32))
|
|
|
|
>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 42, 32))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type NAME = "name";
|
|
|
|
type NAME = "name";
|
|
|
|
>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 43, 36))
|
|
|
|
>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 47, 36))
|
|
|
|
|
|
|
|
|
|
|
|
type WIDTH_OR_HEIGHT = "width" | "height";
|
|
|
|
type WIDTH_OR_HEIGHT = "width" | "height";
|
|
|
|
>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 45, 19))
|
|
|
|
>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 49, 19))
|
|
|
|
|
|
|
|
|
|
|
|
type Q10 = Shape["name"]; // string
|
|
|
|
type Q10 = Shape["name"]; // string
|
|
|
|
>Q10 : Symbol(Q10, Decl(keyofAndIndexedAccess.ts, 46, 42))
|
|
|
|
>Q10 : Symbol(Q10, Decl(keyofAndIndexedAccess.ts, 50, 42))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type Q11 = Shape["width" | "height"]; // number
|
|
|
|
type Q11 = Shape["width" | "height"]; // number
|
|
|
|
>Q11 : Symbol(Q11, Decl(keyofAndIndexedAccess.ts, 48, 25))
|
|
|
|
>Q11 : Symbol(Q11, Decl(keyofAndIndexedAccess.ts, 52, 25))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type Q12 = Shape["name" | "visible"]; // string | boolean
|
|
|
|
type Q12 = Shape["name" | "visible"]; // string | boolean
|
|
|
|
>Q12 : Symbol(Q12, Decl(keyofAndIndexedAccess.ts, 49, 37))
|
|
|
|
>Q12 : Symbol(Q12, Decl(keyofAndIndexedAccess.ts, 53, 37))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type Q20 = Shape[NAME]; // string
|
|
|
|
type Q20 = Shape[NAME]; // string
|
|
|
|
>Q20 : Symbol(Q20, Decl(keyofAndIndexedAccess.ts, 50, 37))
|
|
|
|
>Q20 : Symbol(Q20, Decl(keyofAndIndexedAccess.ts, 54, 37))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 43, 36))
|
|
|
|
>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 47, 36))
|
|
|
|
|
|
|
|
|
|
|
|
type Q21 = Shape[WIDTH_OR_HEIGHT]; // number
|
|
|
|
type Q21 = Shape[WIDTH_OR_HEIGHT]; // number
|
|
|
|
>Q21 : Symbol(Q21, Decl(keyofAndIndexedAccess.ts, 52, 23))
|
|
|
|
>Q21 : Symbol(Q21, Decl(keyofAndIndexedAccess.ts, 56, 23))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 45, 19))
|
|
|
|
>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 49, 19))
|
|
|
|
|
|
|
|
|
|
|
|
type Q30 = [string, number][0]; // string
|
|
|
|
type Q30 = [string, number][0]; // string
|
|
|
|
>Q30 : Symbol(Q30, Decl(keyofAndIndexedAccess.ts, 53, 34))
|
|
|
|
>Q30 : Symbol(Q30, Decl(keyofAndIndexedAccess.ts, 57, 34))
|
|
|
|
|
|
|
|
|
|
|
|
type Q31 = [string, number][1]; // number
|
|
|
|
type Q31 = [string, number][1]; // number
|
|
|
|
>Q31 : Symbol(Q31, Decl(keyofAndIndexedAccess.ts, 55, 31))
|
|
|
|
>Q31 : Symbol(Q31, Decl(keyofAndIndexedAccess.ts, 59, 31))
|
|
|
|
|
|
|
|
|
|
|
|
type Q32 = [string, number][2]; // string | number
|
|
|
|
type Q32 = [string, number][2]; // string | number
|
|
|
|
>Q32 : Symbol(Q32, Decl(keyofAndIndexedAccess.ts, 56, 31))
|
|
|
|
>Q32 : Symbol(Q32, Decl(keyofAndIndexedAccess.ts, 60, 31))
|
|
|
|
|
|
|
|
|
|
|
|
type Q33 = [string, number][E.A]; // string
|
|
|
|
type Q33 = [string, number][E.A]; // string
|
|
|
|
>Q33 : Symbol(Q33, Decl(keyofAndIndexedAccess.ts, 57, 31))
|
|
|
|
>Q33 : Symbol(Q33, Decl(keyofAndIndexedAccess.ts, 61, 31))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
|
|
|
|
>A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 19, 14))
|
|
|
|
>A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 23, 14))
|
|
|
|
|
|
|
|
|
|
|
|
type Q34 = [string, number][E.B]; // number
|
|
|
|
type Q34 = [string, number][E.B]; // number
|
|
|
|
>Q34 : Symbol(Q34, Decl(keyofAndIndexedAccess.ts, 58, 33))
|
|
|
|
>Q34 : Symbol(Q34, Decl(keyofAndIndexedAccess.ts, 62, 33))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
|
|
|
|
>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 19, 17))
|
|
|
|
>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17))
|
|
|
|
|
|
|
|
|
|
|
|
type Q35 = [string, number][E.C]; // string | number
|
|
|
|
type Q35 = [string, number][E.C]; // string | number
|
|
|
|
>Q35 : Symbol(Q35, Decl(keyofAndIndexedAccess.ts, 59, 33))
|
|
|
|
>Q35 : Symbol(Q35, Decl(keyofAndIndexedAccess.ts, 63, 33))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
|
|
|
|
>C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 19, 20))
|
|
|
|
>C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 23, 20))
|
|
|
|
|
|
|
|
|
|
|
|
type Q36 = [string, number]["0"]; // string
|
|
|
|
type Q36 = [string, number]["0"]; // string
|
|
|
|
>Q36 : Symbol(Q36, Decl(keyofAndIndexedAccess.ts, 60, 33))
|
|
|
|
>Q36 : Symbol(Q36, Decl(keyofAndIndexedAccess.ts, 64, 33))
|
|
|
|
|
|
|
|
|
|
|
|
type Q37 = [string, number]["1"]; // string
|
|
|
|
type Q37 = [string, number]["1"]; // string
|
|
|
|
>Q37 : Symbol(Q37, Decl(keyofAndIndexedAccess.ts, 61, 33))
|
|
|
|
>Q37 : Symbol(Q37, Decl(keyofAndIndexedAccess.ts, 65, 33))
|
|
|
|
|
|
|
|
|
|
|
|
type Q40 = (Shape | Options)["visible"]; // boolean | "yes" | "no"
|
|
|
|
type Q40 = (Shape | Options)["visible"]; // boolean | "yes" | "no"
|
|
|
|
>Q40 : Symbol(Q40, Decl(keyofAndIndexedAccess.ts, 62, 33))
|
|
|
|
>Q40 : Symbol(Q40, Decl(keyofAndIndexedAccess.ts, 66, 33))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 11, 1))
|
|
|
|
>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type Q41 = (Shape & Options)["visible"]; // true & "yes" | true & "no" | false & "yes" | false & "no"
|
|
|
|
type Q41 = (Shape & Options)["visible"]; // true & "yes" | true & "no" | false & "yes" | false & "no"
|
|
|
|
>Q41 : Symbol(Q41, Decl(keyofAndIndexedAccess.ts, 64, 40))
|
|
|
|
>Q41 : Symbol(Q41, Decl(keyofAndIndexedAccess.ts, 68, 40))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 11, 1))
|
|
|
|
>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type Q50 = Dictionary<Shape>["howdy"]; // Shape
|
|
|
|
type Q50 = Dictionary<Shape>["howdy"]; // Shape
|
|
|
|
>Q50 : Symbol(Q50, Decl(keyofAndIndexedAccess.ts, 65, 40))
|
|
|
|
>Q50 : Symbol(Q50, Decl(keyofAndIndexedAccess.ts, 69, 40))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type Q51 = Dictionary<Shape>[123]; // Shape
|
|
|
|
type Q51 = Dictionary<Shape>[123]; // Shape
|
|
|
|
>Q51 : Symbol(Q51, Decl(keyofAndIndexedAccess.ts, 67, 38))
|
|
|
|
>Q51 : Symbol(Q51, Decl(keyofAndIndexedAccess.ts, 71, 38))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
type Q52 = Dictionary<Shape>[E.B]; // Shape
|
|
|
|
type Q52 = Dictionary<Shape>[E.B]; // Shape
|
|
|
|
>Q52 : Symbol(Q52, Decl(keyofAndIndexedAccess.ts, 68, 34))
|
|
|
|
>Q52 : Symbol(Q52, Decl(keyofAndIndexedAccess.ts, 72, 34))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
|
|
|
|
>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
|
|
|
|
>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
|
|
|
|
>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 19, 17))
|
|
|
|
>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17))
|
|
|
|
|
|
|
|
|
|
|
|
declare let cond: boolean;
|
|
|
|
declare let cond: boolean;
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
function getProperty<T, K extends keyof T>(obj: T, key: K) {
|
|
|
|
function getProperty<T, K extends keyof T>(obj: T, key: K) {
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 73, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 73, 23))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 73, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 73, 43))
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 73, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 73, 50))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 73, 23))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
|
|
|
|
|
|
|
|
|
|
|
|
return obj[key];
|
|
|
|
return obj[key];
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 73, 43))
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 73, 50))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setProperty<T, K extends keyof T>(obj: T, key: K, value: T[K]) {
|
|
|
|
function setProperty<T, K extends keyof T>(obj: T, key: K, value: T[K]) {
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43))
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 81, 43))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 81, 50))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 77, 58))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 81, 58))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23))
|
|
|
|
|
|
|
|
|
|
|
|
obj[key] = value;
|
|
|
|
obj[key] = value;
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43))
|
|
|
|
>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 81, 43))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 81, 50))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 77, 58))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 81, 58))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f10(shape: Shape) {
|
|
|
|
function f10(shape: Shape) {
|
|
|
|
>f10 : Symbol(f10, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
>f10 : Symbol(f10, Decl(keyofAndIndexedAccess.ts, 83, 1))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
let name = getProperty(shape, "name"); // string
|
|
|
|
let name = getProperty(shape, "name"); // string
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 82, 7))
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 86, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let widthOrHeight = getProperty(shape, cond ? "width" : "height"); // number
|
|
|
|
let widthOrHeight = getProperty(shape, cond ? "width" : "height"); // number
|
|
|
|
>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 83, 7))
|
|
|
|
>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 87, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
let nameOrVisible = getProperty(shape, cond ? "name" : "visible"); // string | boolean
|
|
|
|
let nameOrVisible = getProperty(shape, cond ? "name" : "visible"); // string | boolean
|
|
|
|
>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 84, 7))
|
|
|
|
>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 88, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
setProperty(shape, "name", "rectangle");
|
|
|
|
setProperty(shape, "name", "rectangle");
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
|
|
|
|
|
|
|
|
setProperty(shape, cond ? "width" : "height", 10);
|
|
|
|
setProperty(shape, cond ? "width" : "height", 10);
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
setProperty(shape, cond ? "name" : "visible", true); // Technically not safe
|
|
|
|
setProperty(shape, cond ? "name" : "visible", true); // Technically not safe
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f11(a: Shape[]) {
|
|
|
|
function f11(a: Shape[]) {
|
|
|
|
>f11 : Symbol(f11, Decl(keyofAndIndexedAccess.ts, 88, 1))
|
|
|
|
>f11 : Symbol(f11, Decl(keyofAndIndexedAccess.ts, 92, 1))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
let len = getProperty(a, "length"); // number
|
|
|
|
let len = getProperty(a, "length"); // number
|
|
|
|
>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 91, 7))
|
|
|
|
>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 95, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let shape = getProperty(a, 1000); // Shape
|
|
|
|
let shape = getProperty(a, 1000); // Shape
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 92, 7))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 96, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
|
|
|
|
|
|
|
|
|
|
|
|
setProperty(a, 1000, getProperty(a, 1001));
|
|
|
|
setProperty(a, 1000, getProperty(a, 1001));
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f12(t: [Shape, boolean]) {
|
|
|
|
function f12(t: [Shape, boolean]) {
|
|
|
|
>f12 : Symbol(f12, Decl(keyofAndIndexedAccess.ts, 94, 1))
|
|
|
|
>f12 : Symbol(f12, Decl(keyofAndIndexedAccess.ts, 98, 1))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
let len = getProperty(t, "length");
|
|
|
|
let len = getProperty(t, "length");
|
|
|
|
>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 97, 7))
|
|
|
|
>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 101, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let s1 = getProperty(t, 0); // Shape
|
|
|
|
let s1 = getProperty(t, 0); // Shape
|
|
|
|
>s1 : Symbol(s1, Decl(keyofAndIndexedAccess.ts, 98, 7))
|
|
|
|
>s1 : Symbol(s1, Decl(keyofAndIndexedAccess.ts, 102, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let s2 = getProperty(t, "0"); // Shape
|
|
|
|
let s2 = getProperty(t, "0"); // Shape
|
|
|
|
>s2 : Symbol(s2, Decl(keyofAndIndexedAccess.ts, 99, 7))
|
|
|
|
>s2 : Symbol(s2, Decl(keyofAndIndexedAccess.ts, 103, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let b1 = getProperty(t, 1); // boolean
|
|
|
|
let b1 = getProperty(t, 1); // boolean
|
|
|
|
>b1 : Symbol(b1, Decl(keyofAndIndexedAccess.ts, 100, 7))
|
|
|
|
>b1 : Symbol(b1, Decl(keyofAndIndexedAccess.ts, 104, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let b2 = getProperty(t, "1"); // boolean
|
|
|
|
let b2 = getProperty(t, "1"); // boolean
|
|
|
|
>b2 : Symbol(b2, Decl(keyofAndIndexedAccess.ts, 101, 7))
|
|
|
|
>b2 : Symbol(b2, Decl(keyofAndIndexedAccess.ts, 105, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let x1 = getProperty(t, 2); // Shape | boolean
|
|
|
|
let x1 = getProperty(t, 2); // Shape | boolean
|
|
|
|
>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 102, 7))
|
|
|
|
>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 106, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
|
|
|
|
>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f13(foo: any, bar: any) {
|
|
|
|
function f13(foo: any, bar: any) {
|
|
|
|
>f13 : Symbol(f13, Decl(keyofAndIndexedAccess.ts, 103, 1))
|
|
|
|
>f13 : Symbol(f13, Decl(keyofAndIndexedAccess.ts, 107, 1))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
|
|
|
|
>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 105, 22))
|
|
|
|
>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 109, 22))
|
|
|
|
|
|
|
|
|
|
|
|
let x = getProperty(foo, "x"); // any
|
|
|
|
let x = getProperty(foo, "x"); // any
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 106, 7))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 110, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let y = getProperty(foo, 100); // any
|
|
|
|
let y = getProperty(foo, 100); // any
|
|
|
|
>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 107, 7))
|
|
|
|
>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 111, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let z = getProperty(foo, bar); // any
|
|
|
|
let z = getProperty(foo, bar); // any
|
|
|
|
>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 108, 7))
|
|
|
|
>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 112, 7))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
|
|
|
|
>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
|
|
|
|
>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 105, 22))
|
|
|
|
>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 109, 22))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Component<PropType> {
|
|
|
|
class Component<PropType> {
|
|
|
|
>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
|
|
|
|
>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
|
|
|
|
|
|
|
|
|
|
|
|
props: PropType;
|
|
|
|
props: PropType;
|
|
|
|
>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
|
|
|
|
>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
|
|
|
|
|
|
|
|
|
|
|
|
getProperty<K extends keyof PropType>(key: K) {
|
|
|
|
getProperty<K extends keyof PropType>(key: K) {
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 113, 16))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 113, 42))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 117, 42))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 113, 16))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16))
|
|
|
|
|
|
|
|
|
|
|
|
return this.props[key];
|
|
|
|
return this.props[key];
|
|
|
|
>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
|
|
|
|
>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
|
|
|
|
>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
|
|
|
|
>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
|
|
|
|
>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
|
|
|
|
>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 113, 42))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 117, 42))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setProperty<K extends keyof PropType>(key: K, value: PropType[K]) {
|
|
|
|
setProperty<K extends keyof PropType>(key: K, value: PropType[K]) {
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 120, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 116, 42))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 120, 42))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 120, 16))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 116, 49))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 120, 49))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
|
|
|
|
>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 120, 16))
|
|
|
|
|
|
|
|
|
|
|
|
this.props[key] = value;
|
|
|
|
this.props[key] = value;
|
|
|
|
>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
|
|
|
|
>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
|
|
|
|
>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
|
|
|
|
>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
|
|
|
|
>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
|
|
|
|
>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 116, 42))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 120, 42))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 116, 49))
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 120, 49))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f20(component: Component<Shape>) {
|
|
|
|
function f20(component: Component<Shape>) {
|
|
|
|
>f20 : Symbol(f20, Decl(keyofAndIndexedAccess.ts, 119, 1))
|
|
|
|
>f20 : Symbol(f20, Decl(keyofAndIndexedAccess.ts, 123, 1))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
|
|
|
|
>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
let name = component.getProperty("name"); // string
|
|
|
|
let name = component.getProperty("name"); // string
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 122, 7))
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 126, 7))
|
|
|
|
>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
|
|
|
|
|
|
|
|
let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number
|
|
|
|
let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number
|
|
|
|
>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 123, 7))
|
|
|
|
>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 127, 7))
|
|
|
|
>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean
|
|
|
|
let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean
|
|
|
|
>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 124, 7))
|
|
|
|
>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 128, 7))
|
|
|
|
>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
|
|
|
|
>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
component.setProperty("name", "rectangle");
|
|
|
|
component.setProperty("name", "rectangle");
|
|
|
|
>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
|
|
|
|
|
|
|
|
component.setProperty(cond ? "width" : "height", 10)
|
|
|
|
component.setProperty(cond ? "width" : "height", 10)
|
|
|
|
>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
|
|
|
|
|
|
|
|
component.setProperty(cond ? "name" : "visible", true); // Technically not safe
|
|
|
|
component.setProperty(cond ? "name" : "visible", true); // Technically not safe
|
|
|
|
>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
|
|
|
|
>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
|
|
|
|
>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function pluck<T, K extends keyof T>(array: T[], key: K) {
|
|
|
|
function pluck<T, K extends keyof T>(array: T[], key: K) {
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 134, 15))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 130, 17))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 134, 17))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 134, 15))
|
|
|
|
>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 130, 37))
|
|
|
|
>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 134, 37))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15))
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 134, 15))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 130, 48))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 134, 48))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 130, 17))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 134, 17))
|
|
|
|
|
|
|
|
|
|
|
|
return array.map(x => x[key]);
|
|
|
|
return array.map(x => x[key]);
|
|
|
|
>array.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
>array.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 130, 37))
|
|
|
|
>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 134, 37))
|
|
|
|
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 131, 21))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 135, 21))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 131, 21))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 135, 21))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 130, 48))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 134, 48))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f30(shapes: Shape[]) {
|
|
|
|
function f30(shapes: Shape[]) {
|
|
|
|
>f30 : Symbol(f30, Decl(keyofAndIndexedAccess.ts, 132, 1))
|
|
|
|
>f30 : Symbol(f30, Decl(keyofAndIndexedAccess.ts, 136, 1))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
|
|
|
|
let names = pluck(shapes, "name"); // string[]
|
|
|
|
let names = pluck(shapes, "name"); // string[]
|
|
|
|
>names : Symbol(names, Decl(keyofAndIndexedAccess.ts, 135, 7))
|
|
|
|
>names : Symbol(names, Decl(keyofAndIndexedAccess.ts, 139, 7))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let widths = pluck(shapes, "width"); // number[]
|
|
|
|
let widths = pluck(shapes, "width"); // number[]
|
|
|
|
>widths : Symbol(widths, Decl(keyofAndIndexedAccess.ts, 136, 7))
|
|
|
|
>widths : Symbol(widths, Decl(keyofAndIndexedAccess.ts, 140, 7))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
|
|
|
|
|
|
|
|
|
|
|
|
let nameOrVisibles = pluck(shapes, cond ? "name" : "visible"); // (string | boolean)[]
|
|
|
|
let nameOrVisibles = pluck(shapes, cond ? "name" : "visible"); // (string | boolean)[]
|
|
|
|
>nameOrVisibles : Symbol(nameOrVisibles, Decl(keyofAndIndexedAccess.ts, 137, 7))
|
|
|
|
>nameOrVisibles : Symbol(nameOrVisibles, Decl(keyofAndIndexedAccess.ts, 141, 7))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
|
|
|
|
>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
|
|
|
|
>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
|
|
|
|
>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f31<K extends keyof Shape>(key: K) {
|
|
|
|
function f31<K extends keyof Shape>(key: K) {
|
|
|
|
>f31 : Symbol(f31, Decl(keyofAndIndexedAccess.ts, 138, 1))
|
|
|
|
>f31 : Symbol(f31, Decl(keyofAndIndexedAccess.ts, 142, 1))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 140, 13))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 144, 13))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 140, 36))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 144, 36))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 140, 13))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 144, 13))
|
|
|
|
|
|
|
|
|
|
|
|
const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
|
|
|
|
const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 141, 9))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 145, 9))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 141, 26))
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 145, 26))
|
|
|
|
>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 141, 39))
|
|
|
|
>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 145, 39))
|
|
|
|
>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 141, 49))
|
|
|
|
>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 145, 49))
|
|
|
|
>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 141, 61))
|
|
|
|
>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 145, 61))
|
|
|
|
|
|
|
|
|
|
|
|
return shape[key]; // Shape[K]
|
|
|
|
return shape[key]; // Shape[K]
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 141, 9))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 145, 9))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 140, 36))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 144, 36))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f32<K extends "width" | "height">(key: K) {
|
|
|
|
function f32<K extends "width" | "height">(key: K) {
|
|
|
|
>f32 : Symbol(f32, Decl(keyofAndIndexedAccess.ts, 143, 1))
|
|
|
|
>f32 : Symbol(f32, Decl(keyofAndIndexedAccess.ts, 147, 1))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 145, 13))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 149, 13))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 145, 43))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 149, 43))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 145, 13))
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 149, 13))
|
|
|
|
|
|
|
|
|
|
|
|
const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
|
|
|
|
const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 146, 9))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 9))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 146, 26))
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 150, 26))
|
|
|
|
>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 146, 39))
|
|
|
|
>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 150, 39))
|
|
|
|
>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 146, 49))
|
|
|
|
>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 150, 49))
|
|
|
|
>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 146, 61))
|
|
|
|
>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 150, 61))
|
|
|
|
|
|
|
|
|
|
|
|
return shape[key]; // Shape[K]
|
|
|
|
return shape[key]; // Shape[K]
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 146, 9))
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 9))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 145, 43))
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 149, 43))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function f33<S extends Shape, K extends keyof S>(shape: S, key: K) {
|
|
|
|
|
|
|
|
>f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 152, 1))
|
|
|
|
|
|
|
|
>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 154, 13))
|
|
|
|
|
|
|
|
>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 154, 29))
|
|
|
|
|
|
|
|
>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 154, 13))
|
|
|
|
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 154, 49))
|
|
|
|
|
|
|
|
>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 154, 13))
|
|
|
|
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 154, 58))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 154, 29))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let name = getProperty(shape, "name");
|
|
|
|
|
|
|
|
>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 155, 7))
|
|
|
|
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 154, 49))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let prop = getProperty(shape, key);
|
|
|
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 156, 7))
|
|
|
|
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
|
|
|
|
>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 154, 49))
|
|
|
|
|
|
|
|
>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 154, 58))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 156, 7))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function f34(ts: TaggedShape) {
|
|
|
|
|
|
|
|
>f34 : Symbol(f34, Decl(keyofAndIndexedAccess.ts, 158, 1))
|
|
|
|
|
|
|
|
>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 160, 13))
|
|
|
|
|
|
|
|
>TaggedShape : Symbol(TaggedShape, Decl(keyofAndIndexedAccess.ts, 6, 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let tag1 = f33(ts, "tag");
|
|
|
|
|
|
|
|
>tag1 : Symbol(tag1, Decl(keyofAndIndexedAccess.ts, 161, 7))
|
|
|
|
|
|
|
|
>f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 152, 1))
|
|
|
|
|
|
|
|
>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 160, 13))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let tag2 = getProperty(ts, "tag");
|
|
|
|
|
|
|
|
>tag2 : Symbol(tag2, Decl(keyofAndIndexedAccess.ts, 162, 7))
|
|
|
|
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
|
|
|
|
>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 160, 13))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class C {
|
|
|
|
class C {
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
|
|
|
|
|
|
|
|
|
|
|
|
public x: string;
|
|
|
|
public x: string;
|
|
|
|
>x : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 150, 9))
|
|
|
|
>x : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 165, 9))
|
|
|
|
|
|
|
|
|
|
|
|
protected y: string;
|
|
|
|
protected y: string;
|
|
|
|
>y : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 151, 21))
|
|
|
|
>y : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 166, 21))
|
|
|
|
|
|
|
|
|
|
|
|
private z: string;
|
|
|
|
private z: string;
|
|
|
|
>z : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 152, 24))
|
|
|
|
>z : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 167, 24))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Indexed access expressions have always permitted access to private and protected members.
|
|
|
|
// Indexed access expressions have always permitted access to private and protected members.
|
|
|
|
// For consistency we also permit such access in indexed access types.
|
|
|
|
// For consistency we also permit such access in indexed access types.
|
|
|
|
function f40(c: C) {
|
|
|
|
function f40(c: C) {
|
|
|
|
>f40 : Symbol(f40, Decl(keyofAndIndexedAccess.ts, 154, 1))
|
|
|
|
>f40 : Symbol(f40, Decl(keyofAndIndexedAccess.ts, 169, 1))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type X = C["x"];
|
|
|
|
type X = C["x"];
|
|
|
|
>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 158, 20))
|
|
|
|
>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 173, 20))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type Y = C["y"];
|
|
|
|
type Y = C["y"];
|
|
|
|
>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 159, 20))
|
|
|
|
>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 174, 20))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
|
|
|
|
|
|
|
|
|
|
|
|
type Z = C["z"];
|
|
|
|
type Z = C["z"];
|
|
|
|
>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 160, 20))
|
|
|
|
>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 175, 20))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
|
|
|
|
>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
|
|
|
|
|
|
|
|
|
|
|
|
let x: X = c["x"];
|
|
|
|
let x: X = c["x"];
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 162, 7))
|
|
|
|
>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 177, 7))
|
|
|
|
>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 158, 20))
|
|
|
|
>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 173, 20))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
|
|
|
|
>"x" : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 150, 9))
|
|
|
|
>"x" : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 165, 9))
|
|
|
|
|
|
|
|
|
|
|
|
let y: Y = c["y"];
|
|
|
|
let y: Y = c["y"];
|
|
|
|
>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 163, 7))
|
|
|
|
>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 178, 7))
|
|
|
|
>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 159, 20))
|
|
|
|
>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 174, 20))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
|
|
|
|
>"y" : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 151, 21))
|
|
|
|
>"y" : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 166, 21))
|
|
|
|
|
|
|
|
|
|
|
|
let z: Z = c["z"];
|
|
|
|
let z: Z = c["z"];
|
|
|
|
>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 164, 7))
|
|
|
|
>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 179, 7))
|
|
|
|
>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 160, 20))
|
|
|
|
>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 175, 20))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
|
|
|
|
>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
|
|
|
|
>"z" : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 152, 24))
|
|
|
|
>"z" : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 167, 24))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Repros from #12011
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Base {
|
|
|
|
|
|
|
|
>Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get<K extends keyof this>(prop: K) {
|
|
|
|
|
|
|
|
>get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 184, 12))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 185, 8))
|
|
|
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 185, 30))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 185, 8))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this[prop];
|
|
|
|
|
|
|
|
>this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
|
|
|
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 185, 30))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
set<K extends keyof this>(prop: K, value: this[K]) {
|
|
|
|
|
|
|
|
>set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 187, 5))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 188, 8))
|
|
|
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 188, 30))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 188, 8))
|
|
|
|
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 188, 38))
|
|
|
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 188, 8))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this[prop] = value;
|
|
|
|
|
|
|
|
>this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
|
|
|
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 188, 30))
|
|
|
|
|
|
|
|
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 188, 38))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Person extends Base {
|
|
|
|
|
|
|
|
>Person : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 191, 1))
|
|
|
|
|
|
|
|
>Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parts: number;
|
|
|
|
|
|
|
|
>parts : Symbol(Person.parts, Decl(keyofAndIndexedAccess.ts, 193, 27))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(parts: number) {
|
|
|
|
|
|
|
|
>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 195, 16))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super();
|
|
|
|
|
|
|
|
>super : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.set("parts", parts);
|
|
|
|
|
|
|
|
>this.set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 187, 5))
|
|
|
|
|
|
|
|
>this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 191, 1))
|
|
|
|
|
|
|
|
>set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 187, 5))
|
|
|
|
|
|
|
|
>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 195, 16))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getParts() {
|
|
|
|
|
|
|
|
>getParts : Symbol(Person.getParts, Decl(keyofAndIndexedAccess.ts, 198, 5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.get("parts")
|
|
|
|
|
|
|
|
>this.get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 184, 12))
|
|
|
|
|
|
|
|
>this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 191, 1))
|
|
|
|
|
|
|
|
>get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 184, 12))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OtherPerson {
|
|
|
|
|
|
|
|
>OtherPerson : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 202, 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parts: number;
|
|
|
|
|
|
|
|
>parts : Symbol(OtherPerson.parts, Decl(keyofAndIndexedAccess.ts, 204, 19))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(parts: number) {
|
|
|
|
|
|
|
|
>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 206, 16))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setProperty(this, "parts", parts);
|
|
|
|
|
|
|
|
>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
|
|
|
|
|
|
|
|
>this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 202, 1))
|
|
|
|
|
|
|
|
>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 206, 16))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getParts() {
|
|
|
|
|
|
|
|
>getParts : Symbol(OtherPerson.getParts, Decl(keyofAndIndexedAccess.ts, 208, 5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return getProperty(this, "parts")
|
|
|
|
|
|
|
|
>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
|
|
|
|
|
|
|
|
>this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 202, 1))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|