Skip to content

Commit 9782427

Browse files
committed
showcase stack overflow bug with polyvariants
1 parent c2fe315 commit 9782427

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

analysis/tests/src/PolyRec.res

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let rec sum = x =>
2+
switch x {
3+
| #Leaf => 0
4+
| #Node(value, left, right) => value + left->sum + right->sum
5+
}
6+
7+
let myTree = #Node(
8+
1,
9+
#Node(2, #Node(4, #Leaf, #Leaf), #Node(6, #Leaf, #Leaf)),
10+
#Node(3, #Node(5, #Leaf, #Leaf), #Node(7, #Leaf, #Leaf)),
11+
)
12+
13+
let () = myTree->sum->Js.log
14+
// ^hov
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Hover src/PolyRec.res 12:10
2+
Fatal error: exception Stack overflow

0 commit comments

Comments
 (0)