hg: kulla/dev/langtools: Clarify input language in regards to modifiers:

Brian Goetz brian.goetz at oracle.com
Fri Jan 30 20:15:57 UTC 2015


I don't think this is bad (though a warning would be OK too.)  While 
these modifiers are mostly nonsensical for top-level declarations, 
rejecting them would be too harsh, because it means that people couldn't 
paste in real Java code and have it just "do the right thing."

I would liken this to redeclaration; in a batch-compiled Java program, 
you can't have two versions of "void m()", but in an interactive 
environment, it makes perfect sense to interpret the second declaration 
as replacing the first.  Similarly, it makes sense to take these 
declarations and interpret them leniently through the "I know what you 
mean" filter in the context of an interactive tool.

Wouldn't object to a warning that says "modifier xxx ignored", 
especially in some sort of verbose-diagnostic mode.

On 1/30/2015 3:12 PM, Jonathan Gibbons wrote:
>
> On 01/30/2015 12:11 PM, robert.field at oracle.com wrote:
>>       * The modifiers public, protected, private, static, and final
>> are not allowed on
>>         top-level declarations and are ignored.
>
> Ignoring sounds bad (wrong?)
>
> -- Jon


More information about the kulla-dev mailing list