Closed
Description
Compiler version
3.3.1 and 3.4.0-RC4.
Minimized example
@main
def main(args: String*): Unit =
println("hello")
val config = Config(8080, "docs.scala-lang.org")
given Config = config
println(renderWebsite("/home")(config))
case class Config(port: Int, baseUrl: String)
def renderWebsite(path: String)(using config: Config): String =
"<html>" + renderWidget(List("cart")) + "</html>"
def renderWidget(items: List[String])(using config: Config): String =
"<div>" + items.mkString(
", "
) + s" ${config.port} ${config.baseUrl}" + "</div>"
Output Error/Warning message
-- [E007] Type Mismatch Error: /private/tmp/a.scala:6:33 -----------------------
6 | println(renderWebsite("/home")(config))
| ^^^^^^
| Found: (config : Config)
| Required: Int
|
| longer explanation available when compiling with `-explain`
1 error found
Errors encountered during compilation
Why this Error/Warning was not helpful
Obviously the error message is wrong.
Suggested improvement
It should remind me removing the whole argument or adding keyword using
in line 6.