Skip to content

Commit 8a849a4

Browse files
committed
Default getters accessibility fix
Default getters should have same accessibility as the method they belong to. Previously, it was the accessibility of the parameter, which makes no sense. Fixes #1116.
1 parent 07bf063 commit 8a849a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ object desugar {
186186
vparamss = takeUpTo(normalizedVparamss, n),
187187
tpt = TypeTree(),
188188
rhs = vparam.rhs
189-
).withMods(vparam.mods & AccessFlags)
189+
).withMods(mods & AccessFlags)
190190
val rest = defaultGetters(vparams :: vparamss1, n + 1)
191191
if (vparam.rhs.isEmpty) rest else defaultGetter :: rest
192192
case Nil :: vparamss1 =>

0 commit comments

Comments
 (0)