From e9adc8a690fc1a1aebeebfa5a68c76e193c993ef Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 17 Mar 2016 23:45:13 +0100 Subject: Fix memberExcluding for ClassInfo --- src/dotty/tools/dotc/core/Types.scala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index cec6fd3b1..50800bec7 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -415,8 +415,16 @@ object Types { memberExcluding(name, Flags.Private) } - final def memberExcluding(name: Name, excluding: FlagSet)(implicit ctx: Context): Denotation = - findMember(name, widenIfUnstable, excluding) + final def memberExcluding(name: Name, excluding: FlagSet)(implicit ctx: Context): Denotation = { + // We need a valid prefix for `asSeenFrom` + val pre = this match { + case tp: ClassInfo => + tp.typeRef + case _ => + widenIfUnstable + } + findMember(name, pre, excluding) + } /** Find member of this type with given name and * produce a denotation that contains the type of the member -- cgit v1.2.3