|
@@ -3330,7 +3330,10 @@ let generate_static ctx c f =
|
|
|
let gen_content() =
|
|
|
op ctx (OThrow (make_string ctx ("Requires compiling with -D hl-ver=" ^ ver ^ ".0 or higher") null_pos));
|
|
|
in
|
|
|
- ignore(make_fun ctx ~gen_content (s_type_path c.cl_path,f.cf_name) (alloc_fid ctx c f) (match f.cf_expr with Some { eexpr = TFunction f } -> f | _ -> abort "Missing function body" f.cf_pos) None None)
|
|
|
+ (match f.cf_expr with
|
|
|
+ | Some { eexpr = TFunction fn } -> ignore(make_fun ctx ~gen_content (s_type_path c.cl_path,f.cf_name) (alloc_fid ctx c f) fn None None)
|
|
|
+ | _ -> if not (Meta.has Meta.NoExpr f.cf_meta) then abort "Missing function body" f.cf_pos)
|
|
|
+
|
|
|
else
|
|
|
add_native "std" f.cf_name
|
|
|
| (Meta.HlNative,[] ,_ ) :: _ ->
|
|
@@ -3338,7 +3341,9 @@ let generate_static ctx c f =
|
|
|
| (Meta.HlNative,_ ,p) :: _ ->
|
|
|
abort "Invalid @:hlNative decl" p
|
|
|
| [] ->
|
|
|
- ignore(make_fun ctx (s_type_path c.cl_path,f.cf_name) (alloc_fid ctx c f) (match f.cf_expr with Some { eexpr = TFunction f } -> f | _ -> abort "Missing function body" f.cf_pos) None None)
|
|
|
+ (match f.cf_expr with
|
|
|
+ | Some { eexpr = TFunction fn } -> ignore(make_fun ctx (s_type_path c.cl_path,f.cf_name) (alloc_fid ctx c f) fn None None)
|
|
|
+ | _ -> if not (Meta.has Meta.NoExpr f.cf_meta) then abort "Missing function body" f.cf_pos)
|
|
|
| _ :: l ->
|
|
|
loop l
|
|
|
in
|