Weird message for corralled message

Robert Field robert.field at oracle.com
Wed May 27 16:56:09 UTC 2015


They are different, the second, g(), has an unresolved reference in the 
body, it is corralled and can be referenced by other definitions, the 
body is stubbed-out though, so attempts to execute it will fail.
The first, f(), has an unresolved reference in the signature, it thus 
cannot be corralled, isn't defined, so cannot be referenced by other 
definitions, which, of course, includes not invoked.  It will however be 
updated when A is defined, and at that point can both be referenced and 
invoked.

So, the messages are correct.  You cannot reference something you can't 
invoke, but woould it clarify to say "cannot be referenced or invoked"?

Thanks,
Robert


On 05/27/15 09:18, andrei.eremeev wrote:
> Hi REPL team,
>
> I got weird message that method /f/ cannot be referenced until class A 
> declared, but it can.
> I think the message should mention that /f///cannot be invoked, not 
> referenced.
>
> -> void f(A a) {}
> |  Added method f(A), however, it cannot be referenced until class A 
> is declared
>
> -> void g() { f(new A()); }
> |  Added method g(), however, it cannot be invoked until class A is 
> declared
>
> Andrei Eremeev



More information about the kulla-dev mailing list