Skip to content

Commit 923998e

Browse files
committed
Make instance defs final
1 parent 6f5df94 commit 923998e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ object desugar {
685685
// implicit wrapper is typechecked in same scope as constructor, so
686686
// we can reuse the constructor parameters; no derived params are needed.
687687
DefDef(className.toTermName, constrTparams, defParamss, classTypeRef, creatorExpr)
688-
.withMods(companionMods | Synthetic | Implicit)
688+
.withMods(companionMods | Synthetic | Implicit | Final)
689689
.withSpan(cdef.span) :: Nil
690690
}
691691

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ object Parsers {
25822582
if (tparams.isEmpty && vparamss.isEmpty) ModuleDef(name, templ)
25832583
else TypeDef(name.toTypeName, templ)
25842584
}
2585-
finalizeDef(instDef, addMod(mods, instanceMod), start)
2585+
finalizeDef(instDef, addMod(mods, instanceMod) | Final, start)
25862586
}
25872587

25882588
/* -------- TEMPLATES ------------------------------------------- */

0 commit comments

Comments
 (0)