What is the rule for parenthesis in Scala method invocation?

Viewed 14895

Isn't toList a method that converts something into a List?

If yes so why can't I use parenthesis with it? I must be missing something more fundamental here.

Here is the example:

val l = Array(1,2,3).toList // works fine

val l = Array(1,2,3).toList() // gives the error below

Not enough arguments for method apply: (n: Int)Int in trait LinearSeqOptimized. Unspecified value parameter n.

3 Answers
Related