@@ -104,6 +104,7 @@ class t = object(self)
104
104
let t'' = self#type_ cx t' in
105
105
if t'' == t' then t
106
106
else AbstractT (r, t'')
107
+ | AbstractsT _ -> t
107
108
| AnnotT t' ->
108
109
let t'' = self#type_ cx t' in
109
110
if t'' == t' then t
@@ -169,6 +170,10 @@ class t = object(self)
169
170
let t'' = self#type_ cx t' in
170
171
if t'' == t' then t
171
172
else ClassT t''
173
+ | NonabstractClassT t' ->
174
+ let t'' = self#type_ cx t' in
175
+ if t'' == t' then t
176
+ else NonabstractClassT t''
172
177
| InstanceT (st , su , impl , instt ) ->
173
178
let st' = self#type_ cx st in
174
179
let su' = self#type_ cx su in
@@ -257,7 +262,8 @@ class t = object(self)
257
262
initialized_field_names;
258
263
methods_tmap;
259
264
mixins;
260
- structural } as t ) =
265
+ structural;
266
+ abstracts } as t ) =
261
267
let type_args' = SMap. ident_map (self#type_ cx) type_args in
262
268
let f_tmap = Context. find_props cx fields_tmap in
263
269
let f_tmap' = SMap. ident_map (Property. ident_map_t (self#type_ cx)) f_tmap in
@@ -269,11 +275,13 @@ class t = object(self)
269
275
let methods_tmap' =
270
276
if m_tmap == m_tmap' then methods_tmap
271
277
else Context. make_property_map cx m_tmap in
272
- if type_args == type_args' && methods_tmap == methods_tmap' && fields_tmap == fields_tmap'
278
+ let abstracts' = self#type_ cx abstracts in
279
+ if type_args == type_args' && methods_tmap == methods_tmap'
280
+ && fields_tmap == fields_tmap' && abstracts == abstracts'
273
281
then t
274
282
else
275
283
{class_id; type_args = type_args'; arg_polarities; fields_tmap = fields_tmap';
276
- initialized_field_names; methods_tmap = methods_tmap'; mixins; structural}
284
+ initialized_field_names; methods_tmap = methods_tmap'; mixins; structural; abstracts }
277
285
278
286
method type_param cx ({reason; name; bound; polarity; default} as t ) =
279
287
let bound' = self#type_ cx bound in
@@ -472,7 +480,8 @@ class t = object(self)
472
480
| AssertBinaryInLHST _
473
481
| AssertBinaryInRHST _
474
482
| AssertForInRHST _
475
- | AssertRestParamT _ -> t
483
+ | AssertRestParamT _
484
+ | AssertNonabstractT _ -> t
476
485
| PredicateT (p , t' ) ->
477
486
let p' = self#predicate cx p in
478
487
let t'' = self#type_ cx t' in
@@ -640,6 +649,11 @@ class t = object(self)
640
649
let t2' = self#type_ cx t2 in
641
650
if t1' == t1 && t2' == t2 then t
642
651
else ExportTypeT (r, skip, name, t1', t2')
652
+ | GatherAbstractsT (r , instt , r_map , t' ) ->
653
+ let instt' = self#inst_type cx instt in
654
+ let t'' = self#type_ cx t' in
655
+ if instt' == instt && t'' == t' then t
656
+ else GatherAbstractsT (r, instt', r_map, t'')
643
657
| MapTypeT (r , typemap , t' , cont ) ->
644
658
let t'' = self#type_ cx t' in
645
659
let cont' = self#cont cx cont in
0 commit comments