mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Error reporting improvements for functions & overloads
This commit is contained in:
parent
7f71569e07
commit
b004946266
20 changed files with 114 additions and 89 deletions
|
|
@ -5,7 +5,7 @@
|
|||
--- text ---
|
||||
| {}"" {}"42" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31midentifier "z" is undefined in branch 7dfcaa5b-2163-4f36-116ed-c4ab6bc8d28b[0m
|
||||
[0m[31m[0m[31m[0m[31midentifier "z" is undefined in branch 46991f07-7340-4104-9f35-c1fb62e95088[0m
|
||||
↳ from [4mtest/tests/exported variable nested.ans:12:3[0m in identifier: [2mz[0m[0m
|
||||
↳ from [4mtest/tests/exported variable nested.ans:12:1[0m in text interpolation: [2m| {z} |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($() _)…[0m
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mcan't call overload overload<($(table::($(x) <lua function>)) _), ($(tuple::($(x) type(x) == "tuple" | type(x) == "list")) _), ($(range::($(x) type(x) == t)) _), ($(s::($(x) <lua function>)) <lua function>)>: no function match (42), possible functions were:
|
||||
• (table::($(x) <lua function>)): type check failure for parameter table in function (table::($(x) <lua function>))
|
||||
• (tuple::($(x) type(x) == "tuple" | type(x) == "list")): type check failure for parameter tuple in function (tuple::($(x) type(x) == "tuple" | type(x) == "list"))
|
||||
• (range::($(x) type(x) == t)): type check failure for parameter range in function (range::($(x) type(x) == t))
|
||||
• (s::($(x) <lua function>)): type check failure for parameter s in function (s::($(x) <lua function>))[0m
|
||||
↳ from [4mfor.ans:3:18[0m in call: [2miter(var)[0m[0m
|
||||
↳ from [4mfor.ans:3:12[0m in definition: [2m:iterator = iter(var)[0m[0m
|
||||
↳ from [4mfor.ans:2:1[0m in block: [2m:iterator = iter(var)…[0m[0m
|
||||
↳ from [4mfor.ans:2:68[0m in call: [2m_[0m[0m
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mcan't call overload iter: no function match arguments (42), possible functions were:
|
||||
• $(table::is table) (from stdlib/for.ans:46:1):
|
||||
type check failure for parameter table
|
||||
• $(tuple::is sequence) (from stdlib/for.ans:37:1):
|
||||
type check failure for parameter tuple
|
||||
• $(range::is range) (from stdlib/for.ans:19:1):
|
||||
type check failure for parameter range
|
||||
• $(s::is struct) (from stdlib/for.ans:3:14):
|
||||
type check failure for parameter s[0m
|
||||
↳ from [4mstdlib/for.ans:3:18[0m in call: [2miter(var)[0m[0m
|
||||
↳ from [4mstdlib/for.ans:3:12[0m in definition: [2m:iterator = iter(var)[0m[0m
|
||||
↳ from [4mstdlib/for.ans:2:1[0m in block: [2m:iterator = iter(var)…[0m[0m
|
||||
↳ from [4mstdlib/for.ans:2:71[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/for invalid iterator.ans:1:4[0m in call: [2mfor(:x, 42)[0m[0m
|
||||
↳ from [4m?[0m in block: [2mfor(:x, 42)…[0m
|
||||
--# saved #--
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31mcan't call function $(a, b) _: expected 2 arguments, received 1[0m
|
||||
[0m[31m[0m[31mcan't call function f: expected 2 arguments, received 1[0m
|
||||
↳ from [4mtest/tests/function args arity check fail.ans:4:2[0m in call: [2mf("ok")[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($(a, b) _)…[0m
|
||||
--# saved #--
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31ma function with parameters (a, b) is already defined in the overload[0m
|
||||
[0m[31m[0m[31ma function with parameters $(a, b) is already defined in the overload[0m
|
||||
↳ from [4mtest/tests/function conflict.ans:5:1[0m in definition: [2m:f = ($(a, b) 0)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($(a, b) 0)…[0m
|
||||
--# saved #--
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@
|
|||
--- text ---
|
||||
| {}"" {}"idk" {}" is esperanto" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31mcan't call overload overload<($(name::($(x) type(x) == t)) _), ($(name::($(x) type(x) == t)) _)>: no function match (type(5, "nope")), possible functions were:
|
||||
• (name::($(x) type(x) == t)): type check failure for parameter name in function (name::($(x) type(x) == t))
|
||||
• (name::($(x) type(x) == t)): type check failure for parameter name in function (name::($(x) type(x) == t))[0m
|
||||
[0m[31m[0m[31mcan't call overload a: no function match arguments (type(5, "nope")), possible functions were:
|
||||
• $(name::($(x) type(x) == t)) (from test/tests/function custom type dispatch error.ans:7:1):
|
||||
type check failure for parameter name
|
||||
• $(name::($(x) type(x) == t)) (from test/tests/function custom type dispatch error.ans:4:1):
|
||||
type check failure for parameter name[0m
|
||||
↳ from [4mtest/tests/function custom type dispatch error.ans:14:2[0m in call: [2ma(type(5, "nope"))[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:french name = "french name"…[0m
|
||||
--# saved #--
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
--- text ---
|
||||
| {}"a" |
|
||||
--- text ---
|
||||
| {}"b" |
|
||||
--- text ---
|
||||
| {}"c" |
|
||||
--- text ---
|
||||
| {}"a" |
|
||||
--- text ---
|
||||
| {}"a" |
|
||||
--- text ---
|
||||
| {}"c" |
|
||||
| {}"b" |
|
||||
--- return ---
|
||||
()
|
||||
--# saved #--
|
||||
{"a.checkpoint":false, "a.run":3, "c.checkpoint":false, "c.run":2}
|
||||
{"a.checkpoint":false, "a.run":2, "b.checkpoint":false, "b.run":2, "c.checkpoint":false, "c.run":1}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31midentifier "b" is undefined in branch 7dfcaa5b-2163-4f36-116ed-c4ab6bc8d28b[0m
|
||||
[0m[31m[0m[31m[0m[31midentifier "b" is undefined in branch 46991f07-7340-4104-9f35-c1fb62e95088[0m
|
||||
↳ from [4mtest/tests/function scope wrong.ans:4:7[0m in identifier: [2mb[0m[0m
|
||||
↳ from [4mtest/tests/function scope wrong.ans:4:1[0m in text interpolation: [2m| a: {b} |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = ($() _)…[0m
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31mcan't call overload overload<($(s::($(x) type(x) == t), k::($(x) <lua function>)) = val; _), ($(s::($(x) type(x) == t), k::($(x) <lua function>)) = val; _), ($(s::($(x) type(x) == t), k::($(x) <lua function>)) _), ($(c::($(x) <lua function>), s::($(x) <lua function>)) = v; <lua function>), ($(c::($(x) <lua function>), s::($(x) <lua function>)) = v; <lua function>), ($(c::($(x) <lua function>), s::($(x) <lua function>)) <lua function>)>: no function match (overload<($(b) _), ($(x) _), ($() _)>, "a"), possible functions were:
|
||||
• (s::($(x) type(x) == t), k::($(x) <lua function>)) = val: expected 3 arguments, received 2
|
||||
• (s::($(x) type(x) == t), k::($(x) <lua function>)) = val: expected 3 arguments, received 2
|
||||
• (s::($(x) type(x) == t), k::($(x) <lua function>)): type check failure for parameter s in function (s::($(x) type(x) == t), k::($(x) <lua function>))
|
||||
• (c::($(x) <lua function>), s::($(x) <lua function>)) = v: expected 3 arguments, received 2
|
||||
• (c::($(x) <lua function>), s::($(x) <lua function>)) = v: expected 3 arguments, received 2
|
||||
• (c::($(x) <lua function>), s::($(x) <lua function>)): type check failure for parameter c in function (c::($(x) <lua function>), s::($(x) <lua function>))[0m
|
||||
[0m[31m[0m[31m[0m[31mcan't call overload _._: no function match arguments (overload([($(b) _), ($(x) _), ($() _)]), "a"), possible functions were:
|
||||
• $(s::is script, k::is symbol) = val (from stdlib/script.ans:44:1):
|
||||
expected 3 arguments, received 2
|
||||
• $(s::is script, k::is string) = val (from stdlib/script.ans:42:1):
|
||||
expected 3 arguments, received 2
|
||||
• $(s::is script, k::is string) (from stdlib/script.ans:40:1):
|
||||
type check failure for parameter s
|
||||
• $(c::is function, s::is symbol) = v (from test/tests/function separate variable from variants.ans:10:4):
|
||||
expected 3 arguments, received 2
|
||||
• $(c::is function, s::is string) = v (from test/tests/function separate variable from variants.ans:10:4):
|
||||
expected 3 arguments, received 2
|
||||
• $(c::is function, s::is string) (from test/tests/function separate variable from variants.ans:10:4):
|
||||
type check failure for parameter c[0m
|
||||
↳ from [4mtest/tests/function separate variable from variants.ans:10:4[0m in call: [2mf . "a"[0m[0m
|
||||
↳ from [4mtest/tests/function separate variable from variants.ans:10:1[0m in text interpolation: [2m| {f . "a"} = 2 |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($() _)…[0m
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31mcan't call overload overload<($(a::($(x) <lua function>)) _), ($(x::($(x) <lua function>)) _)>: more than one function match (5), matching functions were at least (specificity 1.3):
|
||||
• (x::($(x) <lua function>))
|
||||
• (a::($(x) <lua function>))[0m
|
||||
[0m[31m[0m[31mcan't call overload fn: more than one function match arguments (5), matching functions were at least (specificity 1.2):
|
||||
• $(x::is number) (from test/tests/function type dispatch ambigous.ans:1:1)
|
||||
• $(a::is number) (from test/tests/function type dispatch ambigous.ans:4:1)[0m
|
||||
↳ from [4mtest/tests/function type dispatch ambigous.ans:7:3[0m in call: [2mfn(5)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:fn = ($(x::number) _)…[0m
|
||||
↳ from [4m?[0m in block: [2m:fn = ($(x::is number) _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -4,14 +4,14 @@
|
|||
↳ from [4mtest/tests/merge nested mutable error bis.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:18[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:30:6[0m in call: [2mfn![0m[0m
|
||||
↳ from [4mscript.ans:28:3[0m in block: [2mresume target = ()…[0m[0m
|
||||
↳ from [4mscript.ans:28:7[0m in call: [2melse![0m[0m
|
||||
↳ from [4mscript.ans:24:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||
↳ from [4mscript.ans:24:9[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:38:9[0m in call: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:1[0m in block: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:20[0m in call: [2m_[0m[0m
|
||||
↳ from [4mstdlib/script.ans:30:6[0m in call: [2mfn![0m[0m
|
||||
↳ from [4mstdlib/script.ans:28:3[0m in block: [2mresume target = ()…[0m[0m
|
||||
↳ from [4mstdlib/script.ans:28:7[0m in call: [2melse![0m[0m
|
||||
↳ from [4mstdlib/script.ans:24:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||
↳ from [4mstdlib/script.ans:24:9[0m in call: [2m_[0m[0m
|
||||
↳ from [4mstdlib/script.ans:38:9[0m in call: [2mvalue(s)![0m[0m
|
||||
↳ from [4mstdlib/script.ans:37:1[0m in block: [2mvalue(s)![0m[0m
|
||||
↳ from [4mstdlib/script.ans:37:20[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:19:2[0m in call: [2mf![0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
||||
--# post run check #--
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
↳ from [4mtest/tests/merge nested mutable error.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:18[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:30:6[0m in call: [2mfn![0m[0m
|
||||
↳ from [4mscript.ans:28:3[0m in block: [2mresume target = ()…[0m[0m
|
||||
↳ from [4mscript.ans:28:7[0m in call: [2melse![0m[0m
|
||||
↳ from [4mscript.ans:24:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||
↳ from [4mscript.ans:24:9[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:38:9[0m in call: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:1[0m in block: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:20[0m in call: [2m_[0m[0m
|
||||
↳ from [4mstdlib/script.ans:30:6[0m in call: [2mfn![0m[0m
|
||||
↳ from [4mstdlib/script.ans:28:3[0m in block: [2mresume target = ()…[0m[0m
|
||||
↳ from [4mstdlib/script.ans:28:7[0m in call: [2melse![0m[0m
|
||||
↳ from [4mstdlib/script.ans:24:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||
↳ from [4mstdlib/script.ans:24:9[0m in call: [2m_[0m[0m
|
||||
↳ from [4mstdlib/script.ans:38:9[0m in call: [2mvalue(s)![0m[0m
|
||||
↳ from [4mstdlib/script.ans:37:1[0m in block: [2mvalue(s)![0m[0m
|
||||
↳ from [4mstdlib/script.ans:37:20[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:19:2[0m in call: [2mf![0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
||||
--# post run check #--
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue