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
The compiler gives a long and strange message in this situation:
Welcome to Scala3.1.1 (11.0.13, JavaOpenJDK64-BitServerVM).
Type in expressions for evaluation. Ortry:help.
scala> extension (s: String) defm(i: Int*) = i.sum
defm(s: String)(i: Int*):Int
scala>"hello".m
-- [E008] NotFoundError:----------------------------------------------------------------------------------------------------1|"hello".m
|^^^^^^^^^|value m is not a member of String.
|An extension method was tried, but could not be fully constructed:
|| {
|def$anonfun(i: <error Missing parameter type||I could not infer the typeof the parameter i.>):Int=| m("hello")(i:<error Missing parameter type||I could not infer the typeof the parameter i.>)
| closure($anonfun)
| } failed with||Missing parameter type||I could not infer the typeof the parameter i.
1 error found
Compiler version
3.1.1
Minimized code and output
The compiler gives a long and strange message in this situation:
It works if the type is explicitly given:
Expectation
It should work and give me a function from Seq[Int] or at least give a better error message.
The text was updated successfully, but these errors were encountered: