errors and warnings / classes / E3005
E3005 error
override problem: missing override, or nothing to override
- area
- classes (x3xxx)
- fails the build
- yes
A problem with override: a method or accessor replaces one a superclass
declares (or implements an abstract one) without override, or it is marked
override but no superclass declares it. The keyword makes replacing a
method a visible choice and catches a misspelt name. Add or remove override,
or fix the name.
Example
class Animal function speak(): string return "..." endendclass Dog extends Animal function speak(): string return "woof" endendprint(Dog.new():speak())class Animal function speak(): string return "..." endendclass Dog extends Animal override function speak(): string return "woof" endendprint(Dog.new():speak())The compiler reports it like this:
error[E3005]: `speak` overrides a member of a superclass; mark it `override` ┌─ src/main.wowlua:7:14 │ 2 │ function speak(): string │ ----- overridden member · 7 │ function speak(): string │ ^^^^^ missing `override`
Related codes
| code | message |
|---|---|
| E3003 | Abstract method not implemented |
Offline
$ wowlua explain E3005 E3005 (error): override problem: missing override, or nothing to override