summaryrefslogtreecommitdiff
path: root/test/files/pos/t8329.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-8329 Better hygiene for patmat partial functionsJason Zaugg2014-03-151-0/+29
Don't enter synthetic parameters of `applyOrElse` et al into scope when typechecking the user-code; instead reference those symbolically. There is an exception to this principle. Currently we allow: val x: PartialFunction[A, B] = x => x match { ... } For this pattern of code, we use the given name `x` for the corresponding method parameter of `applyOrElse` and `isDefinedAt` and we actually need this to be in scope when we typecheck the scrutinee. This construct is tested in `run/virtpatmat_partial.scala`. A new parameter, `paramSynthetic`, differentiates this case from the more typical `val x: PF[A, B] = { case ... => ... ; ... } case, which uses a fresh name need not be in scope. (We could get away with it, as it is fresh, but I thought it better to exclude it.)