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

Cannot call invert in Tuple2Zipped and Tuple3Zipped #11766

Open
seraphr opened this issue Oct 9, 2019 · 1 comment · May be fixed by scala/scala#8471

Comments

@seraphr
Copy link

commented Oct 9, 2019

in scala 2.13.1

[info] Starting scala interpreter...
Welcome to Scala 2.13.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.

scala> (Seq("a","b","c"), Seq("4","5","6")).invert
                                            ^
       error: Cannot prove that Seq[String] <:< It1.

scala> (Seq("a","b","c"), Seq("4","5","6"), Seq(1,2,3)).invert
                                                        ^
       error: Cannot prove that Seq[String] <:< It1.

in Scala 2.12.10

[info] Starting scala interpreter...
Welcome to Scala 2.12.10 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.

scala> (Seq("a","b","c"), Seq("4","5","6")).invert
res0: Seq[(String, String)] = List((a,4), (b,5), (c,6))

scala> (Seq("a","b","c"), Seq("4","5","6"), Seq(1,2,3)).invert
res1: Seq[(String, String, Int)] = List((a,4,1), (b,5,2), (c,6,3))
@seraphr seraphr changed the title Cannot calll invert in Tuple2Zipped and Tuple3Zipped Cannot call invert in Tuple2Zipped and Tuple3Zipped Oct 9, 2019
@xuwei-k xuwei-k added the library label Oct 9, 2019
@martijnhoekstra

This comment has been minimized.

Copy link

commented Oct 9, 2019

Workaround: invert[String, Seq[String], String, Seq[String], Seq[(String, String)]]

When you don't need to cross-build, seq1.lazyZip(seq2)

@SethTisue SethTisue added this to the 2.13.2 milestone Oct 9, 2019
hrhino added a commit to hrhino/scala that referenced this issue Oct 15, 2019
This aligns it with what 2.12 has. I was going to justify this with a
comment on how Dotty also can't infer the types, but as it turns out
Dotty can do so just fine, so now I need to justify this with a comment
on how much more difficult type-inference bugs are to fix.

Fixes scala/bug#11766.
@hrhino hrhino self-assigned this Oct 15, 2019
@hrhino hrhino added the has PR label Oct 15, 2019
hrhino added a commit to hrhino/scala that referenced this issue Oct 15, 2019
This aligns it with what 2.12 has. I was going to justify this with a
comment on how Dotty also can't infer the types, but as it turns out
Dotty can do so just fine, so now I need to justify this with a comment
on how much more difficult type-inference bugs are to fix.

Fixes scala/bug#11766.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.