File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ typedef CTypedef = {> CNamedType,
77
77
78
78
typedef CAbstract = {> CNamedType ,
79
79
var t : TType ;
80
+ var from : Array <TType >;
81
+ var to : Array <TType >;
80
82
}
81
83
82
84
class Completion {
@@ -233,13 +235,21 @@ class CheckerTypes {
233
235
name : a .path ,
234
236
params : [],
235
237
t : null ,
238
+ from : [],
239
+ to : [],
236
240
};
237
241
addMeta (a ,ta );
238
242
for ( p in a .params )
239
243
ta .params .push (TParam (p ));
240
244
todo .push (function () {
241
245
localParams = [for ( t in ta .params ) a .path + " ." + Checker .typeStr (t ) => t ];
242
246
ta .t = makeXmlType (a .athis );
247
+ for ( f in a .from )
248
+ if ( f .field == null )
249
+ ta .from .push (makeXmlType (f .t ));
250
+ for ( t in a .to )
251
+ if ( t .field == null )
252
+ ta .to .push (makeXmlType (t .t ));
243
253
localParams = null ;
244
254
});
245
255
types .set (a .path , CTAbstract (ta ));
@@ -722,6 +732,18 @@ class Checker {
722
732
return true ;
723
733
case [TFun (_ ), TAbstract ({ name : " haxe.Function" },_ )]:
724
734
return true ;
735
+ case [_ , TAbstract (a , args )]:
736
+ for ( ft in a .from ) {
737
+ var t = apply (ft ,a .params ,args );
738
+ if ( tryUnify (t1 ,t ) )
739
+ return true ;
740
+ }
741
+ case [TAbstract (a , args ), _ ]:
742
+ for ( tt in a .to ) {
743
+ var t = apply (tt ,a .params ,args );
744
+ if ( tryUnify (t ,t2 ) )
745
+ return true ;
746
+ }
725
747
default :
726
748
}
727
749
return typeEq (t1 ,t2 );
You can’t perform that action at this time.
0 commit comments