Skip to content

Commit

Permalink
[hl] Use HDyn instead of erroring on recursive types (#11844)
Browse files Browse the repository at this point in the history
* default to HDyn instead of dying upon recursion

* enable related test
  • Loading branch information
Simn authored Nov 26, 2024
1 parent d989ab3 commit 1709bda
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion src/generators/genhl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ let rec to_type ?tref ctx t =
| TType (td,tl) ->
let t =
get_rec_cache ctx t
(fun() -> abort "Unsupported recursive type" td.t_pos)
(fun() -> HDyn)
(fun tref -> to_type ~tref ctx (apply_typedef td tl))
in
(match td.t_path with
Expand Down
11 changes: 0 additions & 11 deletions tests/unit/src/unit/issues/Issue3024.hx
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package unit.issues;

#if hl

// no support for recursive types atm
class Issue3024 extends Test {
}

#else

import haxe.ds.StringMap;
import haxe.ds.Vector;

Expand All @@ -16,7 +8,6 @@ private typedef MyMap = StringMap<MyFunction>;
private typedef MyFunction = MyVector->MyMap->Dynamic;

class Issue3024 extends Test {

private var myVector:MyVector;

private var myMap:MyMap;
Expand All @@ -31,5 +22,3 @@ class Issue3024 extends Test {
this.myMap = myMap;
}
}

#end

0 comments on commit 1709bda

Please sign in to comment.