Skip to content

Commit

Permalink
[hxb] handle another edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Mar 26, 2024
1 parent ed91090 commit e1cd4b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compiler/hxb/hxbWriter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ module HxbWriter = struct
Chunk.write_uleb128 writer.chunk index
with Not_found ->
let restore = start_temporary_chunk writer 256 in
let old = writer.wrote_local_type_param in
writer.wrote_local_type_param <- false;
ignore(write_class_field_and_overloads_data writer true cf);
let bytes = restore (fun new_chunk -> Chunk.get_bytes new_chunk) in
Expand All @@ -1081,7 +1082,8 @@ module HxbWriter = struct
let index = HashedIdentityPool.add writer.anon_fields cf.cf_name cf (Some bytes) in
Chunk.write_u8 writer.chunk 0;
Chunk.write_uleb128 writer.chunk index;
end
end;
writer.wrote_local_type_param <- old

(* Type instances *)

Expand Down
1 change: 1 addition & 0 deletions tests/server/test/templates/issues/Issue11589/Main1.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ typedef Foo<T> = { foo : { bar : T } }

typedef Bar<T> = {
function foo( elements : Array<{ value : T }> ) : Void;
function bar( foo : T, bar : { baz : Bool } ) : Void;
}

0 comments on commit e1cd4b0

Please sign in to comment.