Skip to content

Commit e9adc8a

Browse files
committed
Fix memberExcluding for ClassInfo
1 parent ca2fb9d commit e9adc8a

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
@@ -415,8 +415,16 @@ object Types {
415415
memberExcluding(name, Flags.Private)
416416
}
417417

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

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

0 commit comments

Comments
 (0)