Feedback and comments on ARM proposal - resend

Jeremy Manson jeremy.manson at gmail.com
Wed Mar 18 01:15:49 PDT 2009


I'm pretty sure that it is only definitely unassigned there if it is
definitely unassigned after the switch expression.  If you want it to
compile, you have to place the declaration before the switch
statement.  I could be wrong about that.

Another favorite:

void f(boolean b) {
  final boolean i;
  if (b) {
    i = true;
  }
  if (!b) {
    i = false;
  }
}

Jeremy

On Wed, Mar 18, 2009 at 12:24 AM, Neal Gafter <neal at gafter.com> wrote:
> On Wed, Mar 18, 2009 at 12:13 AM, Jeremy Manson <jeremy.manson at gmail.com> wrote:
>> On Tue, Mar 17, 2009 at 10:43 PM, Neal Gafter <neal at gafter.com> wrote:
>>
>>>            i = 1; // i is not definitely assigned here, so we assign to it
>>
>> The compiler is traditionally not very happy when you assign a value
>> to a final variable. :)
>
> Right... unless it's "definitely unassigned".  Since we've skipped
> over its initialization, it's definitely unassigned, right?
>



More information about the coin-dev mailing list