E07450: function must have no parameters
What went wrong
A function that should have NO parameters has parameters defined.
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 812 (What are common stream pipeline errors in EK9?)
How to fix it
- Remove parameters from function definition
- Or use appropriate function type with parameters
Common causes
- Wrong function type for context
- Copy/paste from parameterized function
See also
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E07450: function must have no parameters
#!ek9 defines module error.e07450.bad defines function howMany() -> count as Integer <- rtn as Integer: count firstOnes() collection <- List() of String //head calls the function with no arguments cat ["last", "first"] | head howMany > collection
Fixed: Give head a function that takes no parameters
#!ek9 defines module error.e07450.good defines function howMany() <- rtn as Integer: 1 firstOnes() <- rtn as List of String: List() cat ["last", "first"] | head howMany > rtn
Questions and answers
These Q&A entries show E07450 and its fix: