The compiler enforces that concrete classes implement all the abstracts methods they inherit from superclasses and traits.
If your class was compiling it meant it wasn't concrete, i.e. it was a trait
or an abstract class
, and you can't force neither to implement the abstract method.
Of course, as soon as you try to obtain a concrete instance the compiler will raise an error as the method is not implemented.
Practical example in the REPL
scala> trait A { def controller: AnyRef }
defined trait A
scala> trait B extends A
defined trait B
scala> abstract class C extends A
defined class C
scala> class D extends A
<console>:8: error: class D needs to be abstract, since method controller in trait A of type => AnyRef is not defined
class D extends A
scala> new B { }
<console>:10: error: object creation impossible, since method controller in trait A of type => AnyRef is not defined
new B { }
^
scala> new C
<console>:10: error: class C is abstract; cannot be instantiated
new C