Bug: problems with forward methods
Robert Field
robert.field at oracle.com
Thu Mar 19 18:27:32 UTC 2015
Both of these are cases were it is unclear if it is just an error or the
user intends to change or add declarations. Not sure how to go here.
-Robert
On 03/19/15 09:13, andrei.eremeev wrote:
> And as for forward variables, I think method "f" can be declared, but
> cannot be executed until "a" with a proper type is declared.
>
> -> double a
> | Added variable a of type double
>
> -> int f() { return a; }
> | Error:
> | incompatible types: possible lossy conversion from double to int
> | int f() { return a; }
> | ^
>
> -> int a
> | Replaced variable a of type int
>
> Andrei Eremeev
>
> On 03/19/2015 06:49 PM, andrei.eremeev wrote:
>> Hi REPL team,
>>
>> The code is not compiled if the name of a forward method equals to
>> the method name in which the forward method is called.
>>
>> -> void f() { f(10); }
>> | Error:
>> | method f in class cannot be applied to given types;
>> | required: no arguments
>> | found: int
>> | reason: actual and formal argument lists differ in length
>> | void f() { f(10); }
>> | ^
>>
>>
>> Andrei Eremeev
>
More information about the kulla-dev
mailing list