Procházet zdrojové kódy

consider abstracts as a with_type for structure declarations only if they allow the assignment (closes #3055)

Simon Krajewski před 11 roky
rodič
revize
e15e2c0c8c
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -2716,7 +2716,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 		| WithType t | WithTypeResume t ->
 			(match follow t with
 			| TAnon a when not (PMap.is_empty a.a_fields) -> Some a
-			| TAbstract (a,tl) when not (Meta.has Meta.CoreType a.a_meta) ->
+			| TAbstract (a,tl) when not (Meta.has Meta.CoreType a.a_meta) && List.exists (fun (_,cfo) -> cfo = None) a.a_from ->
 				begin match follow (Codegen.Abstract.get_underlying_type a tl) with
 					| TAnon a when not (PMap.is_empty a.a_fields) -> Some a
 					| _ -> None