Skip to content

Commit 0794f6d

Browse files
authored
Backport "check for primary constructor in namePresentInSource" to LTS (#19146)
Backports #18325 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents a3597e3 + 6b28f0d commit 0794f6d

File tree

2 files changed

+191
-50
lines changed

2 files changed

+191
-50
lines changed

compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ object Scala3:
4747
// for secondary constructors `this`
4848
desig match
4949
case sym: Symbol =>
50-
if sym.isConstructor && nameInSource == nme.THISkw.toString then
50+
if sym.isConstructor
51+
&& (sym.isPrimaryConstructor || nameInSource == nme.THISkw.toString) then
5152
true
5253
else
5354
val target =

0 commit comments

Comments
 (0)