2
0
Эх сурвалжийг харах

also allow new completion for abstracts

Simon Krajewski 12 жил өмнө
parent
commit
87ab9e3f1a
2 өөрчлөгдсөн 3 нэмэгдсэн , 2 устгасан
  1. 2 1
      typeload.ml
  2. 1 1
      typer.ml

+ 2 - 1
typeload.ml

@@ -138,7 +138,8 @@ let make_module ctx mpath file tdecls loadp =
 								Some (EReturn (Some e), pos e)
 							| Some (EBlock el,p) -> Some (EBlock (init p :: el @ [ret p]),p)
 							| Some e -> Some (EBlock [init p;e;ret p],p)
-							)
+							);
+							f_type = Some this_t;
 						} in
 						{ f with cff_name = "_new"; cff_access = AStatic :: f.cff_access; cff_kind = FFun fu; cff_meta = (":impl",[],p) :: f.cff_meta }
 					| FFun fu when not stat ->

+ 1 - 1
typer.ml

@@ -2589,7 +2589,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 	| EDisplayNew t ->
 		let t = Typeload.load_instance ctx t p true in
 		(match follow t with
-		| TInst (c,params) ->
+		| TInst (c,params) | TAbstract({a_impl = Some c},params) ->
 			let ct, f = get_constructor ctx c params p in
 			raise (DisplayTypes (ct :: List.map (fun f -> f.cf_type) f.cf_overloads))
 		| _ ->