summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-11-07 17:07:51 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-11-07 17:07:51 +1000
commit2dfed21a300724ad61e0863f1cd71260a7ccf507 (patch)
tree345c2f3d36fdda6a4d1c366a13e857a63b46745d /src/reflect
parentb1e6f57b2be7ba986927c798d2fb9687b48fe61c (diff)
parentd76a2812ca56cd0d093fbbeb3ab60b35cd9c3180 (diff)
downloadscala-2dfed21a300724ad61e0863f1cd71260a7ccf507.tar.gz
scala-2dfed21a300724ad61e0863f1cd71260a7ccf507.tar.bz2
scala-2dfed21a300724ad61e0863f1cd71260a7ccf507.zip
Merge pull request #4097 from retronym/ticket/7602
SI-7602 Avoid crash in LUBs with erroneous code
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/tpe/GlbLubs.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala b/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
index 876685e24a..123b44aa05 100644
--- a/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
+++ b/src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
@@ -347,7 +347,9 @@ private[internal] trait GlbLubs {
def lubsym(proto: Symbol): Symbol = {
val prototp = lubThisType.memberInfo(proto)
val syms = narrowts map (t =>
- t.nonPrivateMember(proto.name).suchThat(sym =>
+ // SI-7602 With erroneous code, we could end up with overloaded symbols after filtering
+ // so `suchThat` unsuitable.
+ t.nonPrivateMember(proto.name).filter(sym =>
sym.tpe matches prototp.substThis(lubThisType.typeSymbol, t)))
if (syms contains NoSymbol) NoSymbol