Better func test

This commit is contained in:
Denis Merigoux 2020-11-27 18:40:19 +01:00
parent 180d56df13
commit 80ef321123
3 changed files with 10 additions and 14 deletions

View File

@ -134,9 +134,7 @@ let rec evaluate_expr (e : A.expr Pos.marked) : A.expr Pos.marked =
] )
@ List.map
(fun (_, sub) ->
( Some
"This value is available because the justification of its definition is \
true:",
( Some "This value is available because this justification is true:",
Pos.get_position sub ))
(List.filter
(fun (sub, _) -> not (is_empty_error sub))

View File

@ -3,22 +3,20 @@
/*
new scope S:
param f type int fun of int
param x type int
param b type bool
param out type int
new scope R:
param s scope S
param r type int
scope S:
def f of x1 [ (x1 >= x1) ] := x1 + x1
def f of x2 [ not b ] := x2 * x2
def f of x [ (x >= x) ] := x + x
def f of x [ not b ] := x * x
def b := false
def x := f of 3
def out := f of 5
scope R:
def s.f of x := x + x * x
def r := s.f of 5
def r := s.out
*/

View File

@ -3,11 +3,11 @@
[ERROR] This value is available because the justification of its definition is true:
[ERROR] --> test_func/func.catala
[ERROR] |
[ERROR] 14 | def f of x1 [ (x1 >= x1) ] := x1 + x1
[ERROR] | ^^^^^^^^
[ERROR] 14 | def f of x [ (x >= x) ] := x + x
[ERROR] | ^^^^^^
[ERROR]
[ERROR] This value is available because the justification of its definition is true:
[ERROR] --> test_func/func.catala
[ERROR] |
[ERROR] 15 | def f of x2 [ not b ] := x2 * x2
[ERROR] | ^^^^^
[ERROR] 15 | def f of x [ not b ] := x * x
[ERROR] | ^^^^^