mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
Better func test
This commit is contained in:
parent
180d56df13
commit
80ef321123
@ -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))
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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] 15 | def f of x [ not b ] := x * x
|
||||
[ERROR] | ^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user