E07820: only one method can be marked as a dispatcher entry point
What went wrong
You have multiple methods marked as dispatcher entry points, but only one method can be the dispatcher entry.
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 613 (Can a derived class dispatcher target a private handler i...)
How to fix it
- Mark only one method as dispatcher
- Other methods can be dispatch targets
Common causes
- Multiple dispatcher methods
- Copy/paste error
See also
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E07820: only one method can be marked as a dispatcher entry point
#!ek9 defines module error.e07820.bad defines class Shape as open kind() <- rtn as String: "shape" Circle extends Shape override kind() <- rtn as String: "circle" Describer describe() as dispatcher -> circle as Circle <- rtn as String: "a round " + circle.kind() describe() as dispatcher -> shape as Shape <- rtn as String: "some " + shape.kind() //Only the entry point is marked
Fixed: Mark only the entry point
#!ek9 defines module error.e07820.good defines class Shape as open kind() <- rtn as String: "shape" Circle extends Shape override kind() <- rtn as String: "circle" Describer //The one entry point describe() -> circle as Circle <- rtn as String: "a round " + circle.kind() describe() as dispatcher -> shape as Shape <- rtn as String: "some " + shape.kind() //A handler: not marked
Questions and answers
These Q&A entries show E07820 and its fix: