-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Minimized code
On the REPL:
trait A[F[_]] {}
object A {
def [A](x: A).pure: List[A] = List(x)
val a = "ola".pure[List]
}
Output
4 | val a = "ola".pure[List]
| ^^^^^^^^^^
|value pure is not a member of String, but could be made available as an extension method.
|
|The following import might fix the problem:
|
| import A.pure
|
Expectation
I would expect it to compile.
Also if we have a package object like:
package object p {
trait A[F[_]] {}
object A {
def [A](x: A).pure: List[A] = List(x)
val a = "ola".pure[List]
}
}
The error has a double suggestion.
I don't expect to see the second suggestion.
Furthermore, the suggestion with reserved keywords should have those words on backticks.
| val a = "ola".pure[List]
| ^^^^^^^^^^
|value pure is not a member of String, but could be made available as an extension method.
|
|One of the following imports might fix the problem:
|
| import p.A.pure
| import p.package.A.pure