E50070: cannot use an abstract function in this manner
What went wrong
You're using an abstract function in a context that requires a concrete implementation. Abstract functions define signatures only.
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 848 (Can I assign an abstract function as a delegate in EK9?)
How to fix it
- Create concrete implementation that extends abstract function
- Use concrete subfunction instead of abstract base
- Implement the abstract function body
Common causes
- Trying to call abstract function directly
- Using abstract function where concrete needed
- Missing implementation of abstract function
See also
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E50070: cannot use an abstract function in this manner
#!ek9 defines module error.e50070.bad defines function Processor() as abstract -> input as String <- output as String? demo() <- rtn as String? processor as Processor: Processor rtn: processor("test")
Fixed: Use a concrete function that is a Processor
#!ek9 defines module error.e50070.good defines function Processor() as abstract -> input as String <- output as String? UpperCaseProcessor() is Processor -> input as String <- output as String: input.upperCase() demo() <- rtn as String? processor as Processor: UpperCaseProcessor rtn: processor("test")
Questions and answers
These Q&A entries show E50070 and its fix: