E06300: require one argument only
What went wrong
This operation requires EXACTLY one argument, but you provided a different number (zero or more than one).
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 124 (How do I group and aggregate collection data in EK9?)
How to fix it
- Provide exactly one argument for operations that require it
- For unary operators (++, --, !, ?) - they work on single operand
- Check constructor/method signature
Common causes
- Unary operator with wrong argument count
- Single-parameter constructor with multiple values
- Forgot argument or added extra
See also
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E06300: require one argument only
#!ek9 defines module error.e06300.bad defines function joined() -> first as Integer second as Integer <- rtn as String: `${first}${second}` mapTwoAtATime() stdout <- Stdout() //'map' passes ONE item at a time cat [1, 2, 3] | map with joined > stdout
Fixed: Give 'map' a function of one parameter
#!ek9 defines module error.e06300.good defines function asText() -> number as Integer <- rtn as String: `#${number}` mapOneAtATime() stdout <- Stdout() cat [1, 2, 3] | map with asText > stdout
Questions and answers
These Q&A entries show E06300 and its fix:
Found a problem?
If EK9 reported E06300 for a program you think is valid, or did not report it where it should have, use the compiler form with the smallest program that shows it. If this page is wrong or unclear, use the documentation form. Both are at github.com/ek9lang/ek9-issues.