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
Welcome to Scala3.6.4 (23.0.2, JavaOpenJDK64-BitServerVM).
Type in expressions for evaluation. Ortry:help.
scala>classC { deff(s: String) =42 }
// defined class C
scala>C().f("s")
valres0:Int=42
scala>classC { defapply(s: String) =42 }
// defined class C
scala>C()("s")
valres1:Int=42
scala>C().apply("s")
-- [E050] TypeError:----------------------------------------------------------1|C().apply("s")
|^|objectC does not take parameters
|| longer explanation available when compiling with`-explain`1 error found
scala>
Expectation
Constructor proxy syntax understands that I might want to call apply on my instance.
Should I use subjunctive here? "That it understand my intentions."
Noticed during rewrite of C()() where apply takes implicits. The erroneous application should be C().apply.
Same problem with using:
Welcome to Scala 3.7.0-RC1 (23.0.2, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> class C { def apply(using String) = 42 }
// defined class C
scala> given String = "hello, world"
lazy val given_String: String
scala> C().apply
-- [E050] Type Error: ----------------------------------------------------------
1 |C().apply
|^
|object C does not take parameters
|
| longer explanation available when compiling with `-explain`
1 error found
The text was updated successfully, but these errors were encountered:
Compiler version
3.6.4
Minimized code
Expectation
Constructor proxy syntax understands that I might want to call
apply
on my instance.Should I use subjunctive here? "That it understand my intentions."
Noticed during rewrite of
C()()
where apply takes implicits. The erroneous application should beC().apply
.Same problem with
using
:The text was updated successfully, but these errors were encountered: