Back to Scala3

E152: Extension Can Only Have Defs

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

3.8.4697 B
Original Source

E152: Extension Can Only Have Defs

This error occurs when an extension clause with collective parameters contains something other than method definitions (def). Extension clauses that have collective type or value parameters can only contain method definitions. Other declarations like val, var, type, or nested classes are not allowed in this context.

Note This error was never emitted by stable Scala 3 compiler.

<!-- 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>