Files
modeling-app/rust/kcl-lib/tests/argument_error/execution_error.snap
Adam Chalmers 89bae66257 KCL: User-defined KCL functions in examples etc now use keywords (#6603)
Preparing for the removal of positional functions from the language. The first big step is to change all our KCL code examples, test code, public samples etc to all use keyword functions.

Apologies for how large this PR is. Most of it is:

- Changing example KCL that defined its own functions, so the functions now use keyword arguments rather than positional arguments. E.g. change `cube([20, 20])` to be `cube(center = [20, 20])`.
- Some parts of the code assumed positional code and didn't handle keyword calls, e.g. the linter would only check for positional calls to startSketchOn. Now they should work with either positional or keyword.
- Update all the artifacts

This does _not_ remove support for positional calls. That will be in a follow-up PR.
2025-05-01 12:36:51 -04:00

15 lines
380 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
source: kcl-lib/src/simulation_tests.rs
description: Error from executing argument_error.kcl
---
KCL Semantic error
× semantic: This function expected the input argument to be of type
│ Vec<KclValue> but it's actually of type Function
╭─[5:5]
4 │
5 │ map(f, f = [0, 1])
· ┬
· ╰── tests/argument_error/input.kcl
╰────