We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
import scala.collection.mutable case class Foo[K, V <% Ordered[V]]() extends mutable.HashMap[K,V] { this.toSeq.sortWith(_._2 > _._2) }
yields:
-- Error: local/priv.scala:5:22 ------------------------------------------------ 5 | this.toSeq.sortWith(_._2 > _._2) | ^ | missing parameter type for parameter _$1, expected = ? -- Error: local/priv.scala:5:29 ------------------------------------------------ 5 | this.toSeq.sortWith(_._2 > _._2) | ^ | missing parameter type for parameter _$2, expected = ?
I think it's the ETA expansion, because when I change code so that it's annotated:
import scala.collection.mutable case class Foo[K, V <% Ordered[V]]() extends mutable.HashMap[K,V] { this.toSeq.sortWith { case ((_, v1), (_, v2) => v1 > v2 } }
Dotty fails with:
-- Error: local/priv.scala:5:24 ------------------------------------------------ 5 | this.toSeq.sortWith { case ((_, v1), (_, v2)) => v1 > v2 } | ^ | missing parameter type for parameter x$1 of expanded function x$1 => | x$1 @unchecked match | { | case ((_, v1), (_, v2)) => | v1 > v2 | }, expected = ? -- [E007] Type Mismatch Error: local/priv.scala:5:51 --------------------------- 5 | this.toSeq.sortWith { case ((_, v1), (_, v2)) => v1 > v2 } | ^^ |found: Nothing(v1) |required: ?{ > : ? } | | |Note that implicit conversions cannot be applied because they are ambiguous; | both method Float2float in object Predef and method Byte2byte in object Predef convert from Nothing(v1) to ?{ > : FunProto(v2):? }
The text was updated successfully, but these errors were encountered:
Add regression tests for various open issues
55462a5
Fix scala#1533, scala#2032, scala#2109, scala#2339, scala#3506, scala#4316, scala#5733, scala#5345.
ff5855d
Note that now we write it as
case class Foo[K, V]()(implicit conv: ImplicitConverter[V, Ordered[V]])
Sorry, something went wrong.
Already fixed, regression test in #5800.
No branches or pull requests
yields:
I think it's the ETA expansion, because when I change code so that it's annotated:
Dotty fails with:
The text was updated successfully, but these errors were encountered: