|
| 1 | +=== tests/cases/compiler/nonNullReferenceMatching.ts === |
| 2 | +type ElementRef = (element: HTMLElement | null) => void; |
| 3 | +>ElementRef : Symbol(ElementRef, Decl(nonNullReferenceMatching.ts, 0, 0)) |
| 4 | +>element : Symbol(element, Decl(nonNullReferenceMatching.ts, 0, 19)) |
| 5 | +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) |
| 6 | + |
| 7 | +type ThumbProps = { |
| 8 | +>ThumbProps : Symbol(ThumbProps, Decl(nonNullReferenceMatching.ts, 0, 56)) |
| 9 | + |
| 10 | + elementRef?: ElementRef; |
| 11 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 12 | +>ElementRef : Symbol(ElementRef, Decl(nonNullReferenceMatching.ts, 0, 0)) |
| 13 | +} |
| 14 | + |
| 15 | +type ComponentProps = { |
| 16 | +>ComponentProps : Symbol(ComponentProps, Decl(nonNullReferenceMatching.ts, 4, 1)) |
| 17 | + |
| 18 | + thumbYProps?: ThumbProps; |
| 19 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 20 | +>ThumbProps : Symbol(ThumbProps, Decl(nonNullReferenceMatching.ts, 0, 56)) |
| 21 | + |
| 22 | + thumbXProps: ThumbProps; |
| 23 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 24 | +>ThumbProps : Symbol(ThumbProps, Decl(nonNullReferenceMatching.ts, 0, 56)) |
| 25 | +} |
| 26 | + |
| 27 | +class Component { |
| 28 | +>Component : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 29 | + |
| 30 | + props!: ComponentProps; |
| 31 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 32 | +>ComponentProps : Symbol(ComponentProps, Decl(nonNullReferenceMatching.ts, 4, 1)) |
| 33 | + |
| 34 | + public thumbYElementRef = (ref: HTMLElement | null) => { |
| 35 | +>thumbYElementRef : Symbol(Component.thumbYElementRef, Decl(nonNullReferenceMatching.ts, 12, 27)) |
| 36 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 37 | +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) |
| 38 | + |
| 39 | + typeof this.props.thumbYProps!.elementRef === 'function' && this.props.thumbYProps!.elementRef(ref); |
| 40 | +>this.props.thumbYProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 41 | +>this.props.thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 42 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 43 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 44 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 45 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 46 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 47 | +>this.props.thumbYProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 48 | +>this.props.thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 49 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 50 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 51 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 52 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 53 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 54 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 55 | + |
| 56 | + typeof (this.props.thumbYProps!.elementRef) === 'function' && this.props.thumbYProps!.elementRef(ref); |
| 57 | +>this.props.thumbYProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 58 | +>this.props.thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 59 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 60 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 61 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 62 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 63 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 64 | +>this.props.thumbYProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 65 | +>this.props.thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 66 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 67 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 68 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 69 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 70 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 71 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 72 | + |
| 73 | + typeof ((this.props).thumbYProps!.elementRef)! === 'function' && this.props.thumbYProps!.elementRef(ref); |
| 74 | +>(this.props).thumbYProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 75 | +>(this.props).thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 76 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 77 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 78 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 79 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 80 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 81 | +>this.props.thumbYProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 82 | +>this.props.thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 83 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 84 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 85 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 86 | +>thumbYProps : Symbol(thumbYProps, Decl(nonNullReferenceMatching.ts, 6, 23)) |
| 87 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 88 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 89 | + |
| 90 | + typeof this.props.thumbXProps.elementRef === 'function' && this.props.thumbXProps.elementRef(ref); |
| 91 | +>this.props.thumbXProps.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 92 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 93 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 94 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 95 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 96 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 97 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 98 | +>this.props.thumbXProps.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 99 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 100 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 101 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 102 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 103 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 104 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 105 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 106 | + |
| 107 | + typeof this.props.thumbXProps.elementRef === 'function' && (this.props).thumbXProps.elementRef(ref); |
| 108 | +>this.props.thumbXProps.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 109 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 110 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 111 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 112 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 113 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 114 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 115 | +>(this.props).thumbXProps.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 116 | +>(this.props).thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 117 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 118 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 119 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 120 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 121 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 122 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 123 | + |
| 124 | + typeof this.props.thumbXProps.elementRef === 'function' && (this.props.thumbXProps).elementRef(ref); |
| 125 | +>this.props.thumbXProps.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 126 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 127 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 128 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 129 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 130 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 131 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 132 | +>(this.props.thumbXProps).elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 133 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 134 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 135 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 136 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 137 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 138 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 139 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 140 | + |
| 141 | + typeof this.props.thumbXProps.elementRef === 'function' && ((this.props)!.thumbXProps)!.elementRef(ref); |
| 142 | +>this.props.thumbXProps.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 143 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 144 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 145 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 146 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 147 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 148 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 149 | +>((this.props)!.thumbXProps)!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 150 | +>(this.props)!.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 151 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 152 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 153 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 154 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 155 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 156 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 157 | + |
| 158 | + typeof (this.props.thumbXProps).elementRef === 'function' && ((this.props)!.thumbXProps)!.elementRef(ref); |
| 159 | +>(this.props.thumbXProps).elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 160 | +>this.props.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 161 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 162 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 163 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 164 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 165 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 166 | +>((this.props)!.thumbXProps)!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 167 | +>(this.props)!.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 168 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 169 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 170 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 171 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 172 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 173 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 174 | + |
| 175 | + typeof this.props!.thumbXProps!.elementRef === 'function' && ((this.props)!.thumbXProps)!.elementRef(ref); |
| 176 | +>this.props!.thumbXProps!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 177 | +>this.props!.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 178 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 179 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 180 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 181 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 182 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 183 | +>((this.props)!.thumbXProps)!.elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 184 | +>(this.props)!.thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 185 | +>this.props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 186 | +>this : Symbol(Component, Decl(nonNullReferenceMatching.ts, 9, 1)) |
| 187 | +>props : Symbol(Component.props, Decl(nonNullReferenceMatching.ts, 11, 17)) |
| 188 | +>thumbXProps : Symbol(thumbXProps, Decl(nonNullReferenceMatching.ts, 7, 29)) |
| 189 | +>elementRef : Symbol(elementRef, Decl(nonNullReferenceMatching.ts, 2, 19)) |
| 190 | +>ref : Symbol(ref, Decl(nonNullReferenceMatching.ts, 13, 31)) |
| 191 | + |
| 192 | + }; |
| 193 | +} |
0 commit comments