Skip to content

Commit

Permalink
[eval] apply @:native for externs
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Apr 12, 2024
1 parent 569e52e commit 5c52e4d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/typing/macroContext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,22 @@ and flush_macro_context mint mctx =
| _ ->
()
in
(* Apply native paths for externs only *)
let maybe_apply_native_paths t =
let apply_native = match t with
| TClassDecl c -> has_class_flag c CExtern
| TEnumDecl e -> e.e_extern
| _ -> false
in
if apply_native then Naming.apply_native_paths t
in
let type_filters = [
FiltersCommon.remove_generic_base;
Exceptions.patch_constructors mctx;
(fun mt -> AddFieldInits.add_field_inits mctx.c.curclass.cl_path (RenameVars.init mctx.com) mctx.com mt);
Filters.update_cache_dependencies ~close_monomorphs:false mctx.com;
minimal_restore;
maybe_apply_native_paths
] in
let ready = fun t ->
FiltersCommon.apply_filters_once mctx expr_filters t;
Expand Down

0 comments on commit 5c52e4d

Please sign in to comment.