Skip to content

Commit

Permalink
[hxb] writer: avoid side effects on TAnon fields type
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Oct 11, 2023
1 parent 19d4997 commit 5867b29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compiler/hxb/hxbWriter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ class ['a] hxb_writer
chunk#write_uleb128 i

method write_anon_ref (an : tanon) (ttp : type_params) =
let pfm = Option.get (anon_id#identify true (TAnon an)) in
(* This weird thing avoids breaking #7672 on C# target, which would break by only using hxb writer *)
(* Likely not the right fix, though *)
let anon = duplicate (TAnon an) in

let pfm = Option.get (anon_id#identify true anon) in
let ftp = field_type_parameters#to_list in
let ttp = ttp @ type_type_parameters#to_list in
let i = anons#get_or_add pfm.pfm_path (an,ttp,ftp) in
Expand Down

0 comments on commit 5867b29

Please sign in to comment.