Skip to content

Commit 738c172

Browse files
committed
Fix protected setter generation
1 parent 2164c42 commit 738c172

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
218218
super.transform(tree1)
219219
}
220220
case tree @ Assign(sel: Select, _) =>
221-
superAcc.transformAssign(super.transform(tree))
221+
super.transform(superAcc.transformAssign(tree))
222222
case Inlined(call, bindings, expansion) =>
223223
// Leave only a call trace consisting of
224224
// - a reference to the top-level class from which the call was inlined,

compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class SuperAccessors(thisPhase: DenotTransformer) {
271271
val accPos = tree.pos.focus
272272
val protectedAccessor = clazz.info.decl(accName).symbol orElse {
273273
val newAcc = ctx.newSymbol(
274-
clazz, accName, Artifact, accType, coord = accPos).enteredAfter(thisPhase)
274+
clazz, accName, Artifact | Method, accType, coord = accPos).enteredAfter(thisPhase)
275275
val code = DefDef(newAcc, vrefss => {
276276
val (receiver :: value :: Nil) :: Nil = vrefss
277277
Assign(receiver.select(field), value).withPos(accPos)

tests/pos/i3638.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package p {
2+
package a {
3+
class JavaInteraction(arr: Array[Char])
4+
extends java.io.CharArrayReader(arr) {
5+
class Inner {
6+
{
7+
count = count
8+
}
9+
}
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)