I don’t understand this warning message from the compiler.
/Users/jnewton/Repos/regular-type-expression/cl-robdd-scala/src/test/scala/bdd/BddTestSuite.scala:85:13
Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method size,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function.
assert(BddFalse.size() == 1)
Is the wording of the message awkward or am I just not thinking about it correctly?
I have a method defined as
def size():Int = { ... }
and my call-site uses parens to call the method.
If I remove the parens from the definition and call site, I suppose it will work.
However, the warning message implies that I will still be able to reference the method itself as an eta expansion by omitting the parens.
How can omitting the parens be both a call to the method and also an eta expanded function? Don’t we need two different syntax(es) for two very different semantics?
By the way, I hoped to define the method and call the method with empty parens to emphasize to the caller that this computation might be compute intensive, as it is in some cases a tree traversal which is exponential size w.r.t. the tree depth.
Do I need to add a dummy, unused argument, if I want to retain the parens?
I have tested it, and if I redefine the method like this, everyone seems happy.
def size(unused:Int=0):Int = { ... }