diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-03-17 23:45:13 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-05-28 21:47:28 +0200 |
commit | e9adc8a690fc1a1aebeebfa5a68c76e193c993ef (patch) | |
tree | 3f8f75da95efbbb1f331bc2c029e8ea1d95c9ee5 /src | |
parent | ca2fb9d4890b0fd58e071b0c7baae8bdeaf9fcd4 (diff) | |
download | dotty-e9adc8a690fc1a1aebeebfa5a68c76e193c993ef.tar.gz dotty-e9adc8a690fc1a1aebeebfa5a68c76e193c993ef.tar.bz2 dotty-e9adc8a690fc1a1aebeebfa5a68c76e193c993ef.zip |
Fix memberExcluding for ClassInfo
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 12 |
1 files changed, 10 insertions, 2 deletions
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 |