@@ -105,5 +105,90 @@ Multiple indexers are not supported. [unsupported-syntax]
105105 ^^^^^^^^^^^^^^^^^^^^
106106
107107
108+ Error ------------------------------------------------------------------------------------------------------ test.js:4:8
108109
109- Found 7 errors
110+ Cannot assign object literal to `o1` because in property `bar`: string [1] is incompatible with number [2].
111+ [incompatible-type]
112+
113+ test.js:4:8
114+ 4| bar: "", // error: string ~/~ number
115+ ^^ [1]
116+
117+ References:
118+ test.js:2:23
119+ 2| var o1: {[key: Key1]: number} = {
120+ ^^^^^^ [2]
121+
122+
123+ Error ------------------------------------------------------------------------------------------------------ test.js:7:4
124+
125+ Cannot get `o1.qux` because property `qux` is missing in object type [1]. [prop-missing]
126+
127+ test.js:7:4
128+ 7| o1.qux; // error: qux not found
129+ ^^^
130+
131+ References:
132+ test.js:2:9
133+ 2| var o1: {[key: Key1]: number} = {
134+ ^^^^^^^^^^^^^^^^^^^^^ [1]
135+
136+
137+ Error ----------------------------------------------------------------------------------------------------- test.js:14:4
138+
139+ Cannot get `o2.qux` because property `qux` is missing in object type [1]. [prop-missing]
140+
141+ test.js:14:4
142+ 14| o2.qux; // error: qux not found
143+ ^^^
144+
145+ References:
146+ test.js:12:9
147+ 12| var o2: {[key: Key2]: number} = { foo: 0 }; // OK to leave out bar
148+ ^^^^^^^^^^^^^^^^^^^^^ [1]
149+
150+
151+ Error ----------------------------------------------------------------------------------------------------- test.js:19:1
152+
153+ Cannot extend `C` [1] with `D` because in property `x` > the indexer property's key: property `qux` is missing in object
154+ type [2]. [prop-missing]
155+
156+ test.js:19:1
157+ v---------------------------------------------------
158+ 19| class D extends C<{foo: number, bar: string, ...}> {
159+ 20| x: { foo: number, qux: boolean, ... }; // error: qux not found
160+ 21| }
161+ ^
162+
163+ References:
164+ test.js:19:17
165+ 19| class D extends C<{foo: number, bar: string, ...}> {
166+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]
167+ test.js:19:19
168+ 19| class D extends C<{foo: number, bar: string, ...}> {
169+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2]
170+
171+
172+ Error ----------------------------------------------------------------------------------------------------- test.js:20:6
173+
174+ Cannot extend `C` [1] with `D` because in property `x`: an index signature declaring the expected key / value type is
175+ missing in object type [2] but exists in object type [3]. [incompatible-type]
176+
177+ This property is invariantly typed. See
178+ https://flow.org/en/docs/faq/#why-cant-i-pass-a-string-to-a-function-that-takes-a-string-number.
179+
180+ test.js:20:6
181+ 20| x: { foo: number, qux: boolean, ... }; // error: qux not found
182+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2]
183+
184+ References:
185+ test.js:19:17
186+ 19| class D extends C<{foo: number, bar: string, ...}> {
187+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]
188+ test.js:17:6
189+ 17| x: {[key: $Keys<X>]: any}; // object with larger key set than X's
190+ ^^^^^^^^^^^^^^^^^^^^^^ [3]
191+
192+
193+
194+ Found 12 errors
0 commit comments