Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27412

Re: You put because it is not there

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: You put because it is not there
Date 2014-01-27 18:13 -0500
Organization A noiseless patient Spider
Message-ID <lc6p79$c4q$1@dont-email.me> (permalink)
References <error-message-20140127232916@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 1/27/2014 5:49 PM, Stefan Ram wrote:
>    Sometimes, it is surprising what error messages Java
>    implementations give:
>
> Main.java:3: error: '.class' expected
>            { if( true )int x; }}
>                            ^
>    Does the implementation really expects to see
>    »if( true )int .class« or »if( true ).class«?

     The former.  That's what it said; why should you
disbelieve what it says about its own expectations?  ;-)

     Was its expectation reasonable?  I think so, because
given the prefix `if ( true ) int' I can imagine no other
continuation than `. class' that could be part of a valid
parse, as in `if (true) int.class.getClassLoader();'.

     Can you think of any other valid continuations?

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

Re: You put because it is not there Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-01-27 18:13 -0500

csiph-web