Skip to content

Commit fd0db46

Browse files
committed
Termination analysis: add support for polymorphic variant creation.
1 parent 2309a5a commit fd0db46

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

Changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Exception analysis: add support for Belt modules.
44
- Termination analysis: add support for try blocks.
55
- Termination analysis: add support for array creation.
6+
- Termination analysis: add support for polymorphic variant creation.
67

78
# 2.14.0
89
- Fix issue where type dependencies could get lost if the last file processed is an interface file.

examples/termination/src/TestCyberTruck.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ module TerminationTypes = {
440440
let rec testTry = () => {
441441
try raise(Not_found) catch {
442442
| Not_found =>
443-
progress()
443+
let _ = #abc(progress())
444444
testTry()
445445
| _ =>
446446
let _ = [(), progress(), ()]

examples/termination/src/termination.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@
598598
Termination Analysis for testTry
599599

600600
Termination Analysis
601-
File "./TestCyberTruck.res", line 440, characters 18-164
601+
File "./TestCyberTruck.res", line 440, characters 18-178
602602
testTry returns Progress with trace [progress:Progress; testTry:Progress || progress:Progress; testTry:Progress]
603603

604604
Termination Analysis Stats

src/Arnold.re

+1-1
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ module Compile = {
11541154
let cE = e |> expression(~ctx);
11551155
let cCases = cases |> List.map(case(~ctx)) |> Command.nondet;
11561156
Command.(cE +++ cCases);
1157-
| Texp_variant(_) => assert(false)
1157+
| Texp_variant(_label, eOpt) => eOpt |> expressionOpt(~ctx)
11581158
| Texp_while(_) => assert(false)
11591159
| Texp_for(_) => assert(false)
11601160
| Texp_send(_) => assert(false)

0 commit comments

Comments
 (0)