Why I get error (value apply is not a member of scala.math.BigInt) when I try to execute following code?
var a : BigInt = 12;
a.apply("123", 36);
BigInt#apply is defined in ScalaDoc. Also I tried using implicit apply method invocation, it also doesn’t work:
a("123", 36);
(And second question: It’s true for all objects that calling () is equal to calling object.apply or object apply ?)
BigInt#applyrefers to the object BigInt, not the class BigInt. Specifically to call this method do the following:Or, because
applyis the special method which looks like function application: