Skip to content

Commit 0dd6d42

Browse files
bishaboshaKordyjan
authored andcommitted
check for primary constructor in namePresentInSource
[Cherry-picked 7ee5bb2]
1 parent c6bea3f commit 0dd6d42

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)