Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SI-6925 use concrete type in applyOrElse's match's selecto #1878

Merged
merged 3 commits into from Jan 14, 2013

Conversation

adriaanm
Copy link
Contributor

Fix a regression introduced in 2848373:

PartialFunction synthesis was broken so that we'd get:

scala> def f[T](xs: Set[T]) = xs collect { case x => x }
f: [T](xs: Set[T])scala.collection.immutable.Set[_ <: T]

rather than

scala> def f[T](xs: Set[T]) = xs collect { case x => x }
f: [T](xs: Set[T])scala.collection.immutable.Set[T]

reworked partial function synthesis while I was in the neighborhood
no functional changes (intended) in the second commit

review by @retronym

Fix a regression introduced in 2848373:

PartialFunction synthesis was broken so that we'd get:
```
scala> def f[T](xs: Set[T]) = xs collect { case x => x }
f: [T](xs: Set[T])scala.collection.immutable.Set[_ <: T]
```

rather than
```
scala> def f[T](xs: Set[T]) = xs collect { case x => x }
f: [T](xs: Set[T])scala.collection.immutable.Set[T]
```
no behavioral changes, just highly overdue cleanup
some TODOs for further improvements
@scala-jenkins
Copy link

Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2063/

@scala-jenkins
Copy link

jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2063/

@scala-jenkins
Copy link

Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1349/

@scala-jenkins
Copy link

jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1349/

implement the following review comments by @retronym:
- [x] Please clothe this naked assert.
- [x] Use match to dissect targs and check isFullyDefined.
- [x] Instead of `targs.head`/`targs.last`, use `val argTp :: resTp :: Nil = targs`.
- [x] Add a quasi-quote-style comment for `apply`.
- [x] Factor out mkCastPreservingAnnotations.
@scala-jenkins
Copy link

Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1354/

@scala-jenkins
Copy link

jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1354/

@scala-jenkins
Copy link

Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2069/

@scala-jenkins
Copy link

jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2069/

@retronym
Copy link
Member

lgtm

adriaanm added a commit that referenced this pull request Jan 14, 2013
SI-6925 use concrete type in applyOrElse's match's selecto
@adriaanm adriaanm merged commit 9739002 into scala:2.10.x Jan 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants