|
| 1 | +=== tests/cases/compiler/thisIndexOnExistingReadonlyFieldIsNotNever.ts === |
| 2 | +declare class Component<P, S = {}> { |
| 3 | +>Component : Symbol(Component, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 0)) |
| 4 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 24)) |
| 5 | +>S : Symbol(S, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 26)) |
| 6 | + |
| 7 | + readonly props: Readonly<{ children?: unknown }> & Readonly<P>; |
| 8 | +>props : Symbol(Component.props, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 36)) |
| 9 | +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) |
| 10 | +>children : Symbol(children, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 1, 30)) |
| 11 | +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) |
| 12 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 24)) |
| 13 | + |
| 14 | + state: Readonly<S>; |
| 15 | +>state : Symbol(Component.state, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 1, 67)) |
| 16 | +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) |
| 17 | +>S : Symbol(S, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 26)) |
| 18 | +} |
| 19 | +interface CoachMarkAnchorProps<C> { |
| 20 | +>CoachMarkAnchorProps : Symbol(CoachMarkAnchorProps, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 3, 1)) |
| 21 | +>C : Symbol(C, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 4, 31)) |
| 22 | + |
| 23 | + anchorRef?: (anchor: C) => void; |
| 24 | +>anchorRef : Symbol(CoachMarkAnchorProps.anchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 4, 35)) |
| 25 | +>anchor : Symbol(anchor, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 5, 17)) |
| 26 | +>C : Symbol(C, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 4, 31)) |
| 27 | +} |
| 28 | +type AnchorType<P> = Component<P>; |
| 29 | +>AnchorType : Symbol(AnchorType, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 6, 1)) |
| 30 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 7, 16)) |
| 31 | +>Component : Symbol(Component, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 0)) |
| 32 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 7, 16)) |
| 33 | + |
| 34 | +class CoachMarkAnchorDecorator { |
| 35 | +>CoachMarkAnchorDecorator : Symbol(CoachMarkAnchorDecorator, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 7, 34)) |
| 36 | + |
| 37 | + decorateComponent<P>(anchor: P) { |
| 38 | +>decorateComponent : Symbol(CoachMarkAnchorDecorator.decorateComponent, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 9, 32)) |
| 39 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 10, 22)) |
| 40 | +>anchor : Symbol(anchor, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 10, 25)) |
| 41 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 10, 22)) |
| 42 | + |
| 43 | + return class CoachMarkAnchor extends Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}> { |
| 44 | +>CoachMarkAnchor : Symbol(CoachMarkAnchor, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 11, 14)) |
| 45 | +>Component : Symbol(Component, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 0)) |
| 46 | +>CoachMarkAnchorProps : Symbol(CoachMarkAnchorProps, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 3, 1)) |
| 47 | +>AnchorType : Symbol(AnchorType, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 6, 1)) |
| 48 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 10, 22)) |
| 49 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 10, 22)) |
| 50 | + |
| 51 | + private _onAnchorRef = (anchor: AnchorType<P>) => { |
| 52 | +>_onAnchorRef : Symbol(CoachMarkAnchor._onAnchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 11, 101)) |
| 53 | +>anchor : Symbol(anchor, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 12, 36)) |
| 54 | +>AnchorType : Symbol(AnchorType, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 6, 1)) |
| 55 | +>P : Symbol(P, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 10, 22)) |
| 56 | + |
| 57 | + const anchorRef = this.props.anchorRef; |
| 58 | +>anchorRef : Symbol(anchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 13, 21)) |
| 59 | +>this.props.anchorRef : Symbol(anchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 4, 35)) |
| 60 | +>this.props : Symbol(Component.props, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 36)) |
| 61 | +>this : Symbol(CoachMarkAnchor, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 11, 14)) |
| 62 | +>props : Symbol(Component.props, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 0, 36)) |
| 63 | +>anchorRef : Symbol(anchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 4, 35)) |
| 64 | + |
| 65 | + if (anchorRef) { |
| 66 | +>anchorRef : Symbol(anchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 13, 21)) |
| 67 | + |
| 68 | + anchorRef(anchor); |
| 69 | +>anchorRef : Symbol(anchorRef, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 13, 21)) |
| 70 | +>anchor : Symbol(anchor, Decl(thisIndexOnExistingReadonlyFieldIsNotNever.ts, 12, 36)) |
| 71 | + } |
| 72 | + } |
| 73 | + }; |
| 74 | + } |
| 75 | +} |
| 76 | + |
0 commit comments