Skip to content

Commit 058e88d

Browse files
committed
Fix handling of constructors
1 parent 44a07d6 commit 058e88d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,7 @@ object SymDenotations {
18831883
val ownDenots = info.decls.denotsNamed(name)
18841884
if debugTrace then
18851885
println(s"$this.member($name), ownDenots = $ownDenots")
1886-
if name.isConstructorName then ownDenots
1887-
else addInherited(name, ownDenots)
1886+
addInherited(name, ownDenots)
18881887

18891888
private def addInherited(name: Name, ownDenots: PreDenotation)(using Context): PreDenotation =
18901889
def collect(denots: PreDenotation, parents: List[Type]): PreDenotation = parents match
@@ -1897,7 +1896,8 @@ object SymDenotations {
18971896
case _ =>
18981897
denots1
18991898
case nil => denots
1900-
collect(ownDenots, classParents)
1899+
if name.isConstructorName then ownDenots
1900+
else collect(ownDenots, classParents)
19011901

19021902
override final def findMember(name: Name, pre: Type, required: FlagSet, excluded: FlagSet)(using Context): Denotation =
19031903
val raw = if excluded.is(Private) then nonPrivateMembersNamed(name) else membersNamed(name)

0 commit comments

Comments
 (0)