Back to Scala3

E105: Trait Redefined Final Method From AnyRef

docs/_docs/reference/error-codes/E105.md

3.8.4838 B
Original Source

E105: Trait Redefined Final Method From AnyRef

This error is intended to be emitted when a trait attempts to redefine a final method from AnyRef (also known as java.lang.Object).

The compiler message indicates:

  • Traits cannot redefine final methods from class AnyRef
  • Methods like getClass, notify, notifyAll, and wait are final in AnyRef

Note: While this error message class exists in the compiler, it is not currently instantiated by any code path. Attempting to redefine these methods produces different errors (such as E120 DoubleDefinitionID).

<!-- SOURCE-ONLY: Remove the notice below once this page has been manually updated. --> <aside class="warning"> This reference page was created with LLM assistance - the description of the error code may not be accurate or cover all possible scenarios. </aside>