-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showcase stack overflow bug with polyvariants (#851)
* showcase stack overflow bug with polyvariants * Mark where the stack overflow happens. * try something * changelog * remove debug --------- Co-authored-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
- Loading branch information
1 parent
e11dfe3
commit de25a65
Showing
6 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
let rec sum = x => | ||
switch x { | ||
| #Leaf => 0 | ||
| #Node(value, left, right) => value + left->sum + right->sum | ||
} | ||
|
||
let myTree = #Node( | ||
1, | ||
#Node(2, #Node(4, #Leaf, #Leaf), #Node(6, #Leaf, #Leaf)), | ||
#Node(3, #Node(5, #Leaf, #Leaf), #Node(7, #Leaf, #Leaf)), | ||
) | ||
|
||
let () = myTree->sum->Js.log | ||
// ^hov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Hover src/PolyRec.res 12:10 | ||
{"contents": {"kind": "markdown", "value": "```rescript\n([#Leaf | #Node(int, 'a, 'a)] as 'a)\n```"}} | ||
|