errors and warnings / classes / E3003
E3003 error
Abstract method not implemented
- area
- classes (x3xxx)
- fails the build
- yes
A concrete class doesn't implement an abstract method it inherits. Implement
it with override function, or make the class abstract too. The code is
also reported for an abstract method in a class that isn't marked
abstract. In debug builds an unimplemented abstract method is a stub that
raises an error when called.
Example
abstract class Shape abstract function area(): numberendclass Square extends Shape side: number = 2endprint(Square.new())abstract class Shape abstract function area(): numberendclass Square extends Shape side: number = 2 override function area(): number return self.side * self.side endendprint(Square.new())The compiler reports it like this:
error[E3003]: class `Square` does not implement the abstract method `area` ┌─ src/main.wowlua:4:7 │ 4 │ class Square extends Shape │ ^^^^^^ not abstract
Related codes
| code | message |
|---|---|
| E3002 | Cannot instantiate an abstract class |
| E3005 | override problem: missing override, or nothing to override |
Offline
$ wowlua explain E3003 E3003 (error): Abstract method not implemented