overloaded local function

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

Re: overloaded local function

On Tue, Feb 7, 2012 at 3:35 AM, HjP <Hjalmar [dot] Peters [at] gmx [dot] 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

overloaded local function

What's the reason?

On Tuesday, February 7, 2012, Jason Zaugg wrote:
On Tue, Feb 7, 2012 at 3:35 AM, HjP <Hjalmar [dot] Peters [at] gmx [dot] 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

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland