diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 66a1e44622b8..d0bf0f4da6dc 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -768,7 +768,7 @@ object SymDenotations { /** Is this a getter? */ final def isGetter(using Context): Boolean = - this.is(Accessor) && !originalName.isSetterName && !originalName.isScala2LocalSuffix + this.is(Accessor) && !originalName.isSetterName && !(originalName.isScala2LocalSuffix && symbol.owner.is(Scala2x)) /** Is this a setter? */ final def isSetter(using Context): Boolean = diff --git a/tests/run/i15943.check b/tests/run/i15943.check new file mode 100644 index 000000000000..8bd6648ed130 --- /dev/null +++ b/tests/run/i15943.check @@ -0,0 +1 @@ +asdf diff --git a/tests/run/i15943.scala b/tests/run/i15943.scala new file mode 100644 index 000000000000..d45318ecfa23 --- /dev/null +++ b/tests/run/i15943.scala @@ -0,0 +1,7 @@ +case class A(`a `: String) + +@main +def Test = { + val a = A("asdf") + println(a.`a `) +}