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

Regression with nested implicit lookups involving a type alias #6854

Closed
scabug opened this issue Dec 20, 2012 · 4 comments
Closed

Regression with nested implicit lookups involving a type alias #6854

scabug opened this issue Dec 20, 2012 · 4 comments

Comments

@scabug
Copy link

scabug commented Dec 20, 2012

With argonaut we discovered the following regression(this works in 2.9.2):

scala> import org.scalacheck._
import org.scalacheck._
 
scala> type ListString = List[String]
defined type alias ListString
 
scala> implicitly[Arbitrary[List[String] => List[String]]]
res0: org.scalacheck.Arbitrary[List[String] => List[String]] = org.scalacheck.Arbitrary$$anon$2@7e4cd909
 
scala> implicitly[Arbitrary[ListString => ListString]]
<console>:24: error: could not find implicit value for parameter e: org.scalacheck.Arbitrary[ListString => ListString]
              implicitly[Arbitrary[ListString => ListString]]

As you can see replacing the type alias with the type it represents works, but with the type alias in place we get a failure.

@scabug
Copy link
Author

scabug commented Dec 20, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6854?orig=1
Reporter: Sean Parsons (seanparsons)
Affected Versions: 2.10.0-RC5, 2.10.0
See #6846

@scabug
Copy link
Author

scabug commented Jan 7, 2013

@adriaanm said:
fixed in 2.11, likely by Paul's work on dealiasWiden -- should see if we can backport that to 2.10.x

@scabug
Copy link
Author

scabug commented Jan 8, 2013

@retronym said (edited on Jan 8, 2013 6:25:58 PM UTC):
Backport for 2.10.x

I've manually checked that this works:

backport/1826 ~/code/scala squala -classpath build/quick/classes/scalacheck
Welcome to Scala version 2.10.1-20130108-190630-3b74691d35 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import org.scalacheck._
import org.scalacheck._

scala> type ListString = List[String]
defined type alias ListString

scala> implicitly[Arbitrary[List[String] => List[String]]]
res0: org.scalacheck.Arbitrary[List[String] => List[String]] = org.scalacheck.Arbitrary$$anon$1@7d365e01

scala> implicitly[Arbitrary[ListString => ListString]]
res1: org.scalacheck.Arbitrary[ListString => ListString] = org.scalacheck.Arbitrary$$anon$1@7fc4fe21

I haven't added this as a test case as this is a straight duplicate of #6846 which was already tested.

@scabug
Copy link
Author

scabug commented Jan 12, 2013

@retronym said:
scala/scala#1869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants