Function types (#6891)
* Change Fn to fn for function types Signed-off-by: Nick Cameron <nrc@ncameron.org> * Support args and return types in function types Signed-off-by: Nick Cameron <nrc@ncameron.org> * Use fancy function types in the docs Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -4,7 +4,8 @@ description: Error from executing argument_error.kcl
|
||||
---
|
||||
KCL Semantic error
|
||||
|
||||
× semantic: f requires a value with type `Fn`, but found array (list)
|
||||
× semantic: f requires a value with type `fn(any): any`, but found array
|
||||
│ (list)
|
||||
╭─[5:1]
|
||||
4 │
|
||||
5 │ map(f, f = [0, 1])
|
||||
@ -14,7 +15,8 @@ KCL Semantic error
|
||||
╰────
|
||||
╰─▶ KCL Semantic error
|
||||
|
||||
× semantic: f requires a value with type `Fn`, but found array (list)
|
||||
× semantic: f requires a value with type `fn(any): any`, but found
|
||||
│ array (list)
|
||||
╭─[5:12]
|
||||
4 │
|
||||
5 │ map(f, f = [0, 1])
|
||||
|
||||
Reference in New Issue
Block a user