- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
overloaded local function
Tue, 2012-02-07, 03:35
Hi,
why does the following declaration of the overloaded local function
"inner" lead to the error "method is defined twice":
def outer() {
def inner():Int = 1
def inner(x: Int):Int = x
}
Thanks,
HjP
Thu, 2012-02-09, 04:11
#2
overloaded local function
What's the reason?
On Tuesday, February 7, 2012, Jason Zaugg wrote:
On Tuesday, February 7, 2012, Jason Zaugg wrote:
On Tue, Feb 7, 2012 at 3:35 AM, HjP <Hjalmar.Peters@gmx.de> wrote:
Hi,
why does the following declaration of the overloaded local function
"inner" lead to the error "method is defined twice":
def outer() {
def inner():Int = 1
def inner(x: Int):Int = x
}
The language does not allow overloading of local methods. Choose different names for them.
-jason
The language does not allow overloading of local methods. Choose different names for them.
-jason