Skip to content

Commit 12d0515

Browse files
committed
Fix memberExcluding for ClassInfo
1 parent 5d70ad7 commit 12d0515

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,16 @@ object Types {
413413
memberExcluding(name, Flags.Private)
414414
}
415415

416-
final def memberExcluding(name: Name, excluding: FlagSet)(implicit ctx: Context): Denotation =
417-
findMember(name, widenIfUnstable, excluding)
416+
final def memberExcluding(name: Name, excluding: FlagSet)(implicit ctx: Context): Denotation = {
417+
// We need a valid prefix for `asSeenFrom`
418+
val pre = this match {
419+
case tp: ClassInfo =>
420+
tp.typeRef
421+
case _ =>
422+
widenIfUnstable
423+
}
424+
findMember(name, pre, excluding)
425+
}
418426

419427
/** Find member of this type with given name and
420428
* produce a denotation that contains the type of the member

0 commit comments

Comments
 (0)