Closed
Description
minimized code
scala> type F[T]
| type G[T]
| type Stuff
| delegate for Stuff = ???
|
| def (x: T) f[T] given Stuff: F[T] = ???
|
def Stuff_instance: Stuff
def f[T](x: T) given (x$1: Stuff): F[T]
scala> def g[T](x: T): F[G[T]] = x.f given the[Stuff]
1 |def g[T](x: T): F[G[T]] = x.f given the[Stuff]
| ^
| method f does not take more parameters
Used as follows, the error message is fine:
scala> def g[T](x: T): F[G[T]] = x.f
1 |def g[T](x: T): F[G[T]] = x.f
| ^
| Found: F[T]
| Required: F[G[T]]
scala> def g[T](x: T): F[G[T]] = f(x) given the[Stuff]
1 |def g[T](x: T): F[G[T]] = f(x) given the[Stuff]
| ^^^^^^^^^^^^^^^^^^^^^
| Found: F[T]
| Required: F[G[T]]
expectation
In def g[T](x: T): F[G[T]] = x.f given the[Stuff]
, the error message should be:
| Found: F[T]
| Required: F[G[T]]