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

Weird new "unspliceable type" error in a definition of unzip for Arrays #8372

Closed
scabug opened this issue Mar 7, 2014 · 6 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 7, 2014

def unzip[T1, T2](a: Array[(T1, T2)]) = a.unzip
error: tpe T1 is an unresolved spliceable type
@scabug
Copy link
Author

scabug commented Mar 7, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8372?orig=1
Reporter: @dlwh
Affected Versions: 2.11.0-RC1

@scabug
Copy link
Author

scabug commented Mar 7, 2014

@gkossakowski said:
I'm bisecting it.

@scabug
Copy link
Author

scabug commented Mar 7, 2014

@gkossakowski said:
Regressed in:

commit b8a76f688c6ce2a4c305da064303bb46b53be875
Author: Rex Kerr <ichoran@gmail.com>
Date:   Tue Dec 31 08:51:49 2013 -0800

    SI-8081 unzip/unzip3 return wrong static type when applied to Arrays
    
    Added unzip and unzip3 methods to ArrayOps so that we get proper return
    values.  (No tests due to unfavorable effort/reward ratio for an ongoing
    test of something so simple.)

@scabug
Copy link
Author

scabug commented Mar 7, 2014

@gkossakowski said:
The quoted commit made Array.unzip require a ClassTag. The ClassTag is required so unzip can have precise return type as requested in #8081. The error message is misleading due to failure of type inference caused by suboptimal signature of ArrayOps.unzip method.

Strictly speaking, the change made in b8a76f688c6ce2a4c305da064303bb46b53be875 broke source compatibility but I think that's ok in this case. What needs fixing is signature of ArrayOps.unzip method so proper error message is printed.

@scabug
Copy link
Author

scabug commented Mar 7, 2014

@gkossakowski said:
scala/scala#3605

@scabug
Copy link
Author

scabug commented Mar 7, 2014

@dlwh said:
Just to follow up with a related error:

#8373

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