docs/_docs/reference/error-codes/E050.md
This error is emitted when you try to pass arguments to a method or expression that doesn't accept parameters.
This can happen when:
object Hello
val message = Hello("World")
-- [E050] Type Error: example.scala:2:14 ---------------------------------------
2 |val message = Hello("World")
| ^^^^^
| object Hello does not take parameters
|-----------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| You have specified more parameter lists than defined in the method definition(s).
-----------------------------------------------------------------------------
// Enusre that method you want to call exists, especially if it involved Scala syntax desugaring
object Hello:
def apply(value: String) = ???
val message = Hello("World")
// Enusre that that method actually takes arguments list
class Bag extends scala.reflect.Selectable
def example =
val bag = new Bag:
val f1 = 23
val x = bag.f1 // instead of bag.f1()