Permalink
Browse files

Fix infinite recursion in name-based patmat.

I discovered on erroneous code it could fall into a loop looking
for product selectors, because ErrorType always claims to have
whatever member you're asking about.
  • Loading branch information...
1 parent 9dae742 commit 10f58e9d6aec2026772129dc540b95defe267025 @paulp paulp committed Jan 9, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/reflect/scala/reflect/internal/Definitions.scala
@@ -847,7 +847,9 @@ trait Definitions extends api.StandardDefinitions {
case m if m.paramss.nonEmpty => Nil
case m => m :: loop(n + 1)
}
- loop(1)
+ // Since ErrorType always returns a symbol from a call to member, we
+ // had better not start looking for _1, _2, etc. expecting it to run out.
+ if (tpe.isErroneous) Nil else loop(1)
}
/** If `tp` has a term member `name`, the first parameter list of which

0 comments on commit 10f58e9

Please sign in to comment.