mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Ignore defaults values in parameter type check
This commit is contained in:
parent
9acde377c2
commit
7abb116876
3 changed files with 48 additions and 2 deletions
20
test/results/function type dispatch with default.ans
Normal file
20
test/results/function type dispatch with default.ans
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
--# run #--
|
||||
--- text ---
|
||||
| {}"a"|
|
||||
--- text ---
|
||||
| {}"x"|
|
||||
--- text ---
|
||||
| {}"a"|
|
||||
--- text ---
|
||||
| {}"" {}"gs" {}""|
|
||||
| {}"" {}"gn" {}""|
|
||||
| {}"" {}"gs" {}""|
|
||||
| {}"" {}"gn" {}""|
|
||||
| {}"" {}"gs" {}""|
|
||||
| {}"" {}"gn" {}""|
|
||||
| {}"" {}"gs" {}""|
|
||||
| {}"" {}"gn" {}""|
|
||||
--- return ---
|
||||
()
|
||||
--# saved #--
|
||||
{}
|
||||
26
test/tests/function type dispatch with default.ans
Normal file
26
test/tests/function type dispatch with default.ans
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
:$ fn(x::number)
|
||||
|x
|
||||
|
||||
:$ fn(a::string="o")
|
||||
|a
|
||||
|
||||
fn("s")
|
||||
|
||||
fn(5)
|
||||
|
||||
fn()
|
||||
|
||||
:$ g(n="s", a::number=5)
|
||||
@"gn"
|
||||
|
||||
:$ g(n="s", a::string="lol")
|
||||
@"gs"
|
||||
|
||||
|{g(n="k", a="l")}
|
||||
|{g(n="k", a=1)}
|
||||
|{g(n="k", "l")}
|
||||
|{g(n="k", 1)}
|
||||
|{g("k", "l")}
|
||||
|{g("k", 1)}
|
||||
|{g("k", a="l")}
|
||||
|{g("k", a=1)}
|
||||
Loading…
Add table
Add a link
Reference in a new issue