You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[error] ./bug.scala:20:5: type mismatch;
[error] found : a.type (with underlying type Object)
[error] required: ?{def bar(x$1: ? >: Int(42)): ?}
[error] Note that implicit conversions are not applicable because they are ambiguous:
[error] both method BarOps1 in package syntax of type (a: Any): foo.syntax.package.BarOps1
[error] and method BarOps2 in package syntax of type (a: Any): foo.syntax.package.BarOps2
[error] are possible conversion functions from a.type to ?{def bar(x$1: ? >: Int(42)): ?}
[error] a.bar(42)
[error] ^
[error] ./bug.scala:20:5: value bar is not a member of Object
[error] a.bar(42)
[error] ^^^^^
It's surprising that the conversion is ambiguous, since BarOps2 should not have publicly visible methods. Note also that changing to private will solve the problem.
Reproduction steps
Scala version: (Is the bug only in Scala 3.x? If so, report it at https://github.com/lampepfl/dotty/issues/new/choose instead.)
Problem
It's surprising that the conversion is ambiguous, since
BarOps2
should not have publicly visible methods. Note also that changing toprivate
will solve the problem.Credit to @BalmungSan for identifying the issue while working on typelevel/cats#4183.
The text was updated successfully, but these errors were encountered: