http://d.puremagic.com/issues/show_bug.cgi?id=5432

           Summary: if/for/while inconsistency: while( auto a = ... ) does
                    not compile
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nob...@puremagic.com
        ReportedBy: eric.estieven...@free.fr


--- Comment #0 from �ric Esti�venart <eric.estieven...@free.fr> 2011-01-08 
06:31:02 PST ---
void f()
{
  Object get() { return null; }
  if( auto a = get() )                {} // OK
  for( auto a = get(); a; a = get() ) {} // OK
  while( auto a = get() )             {} // Does not compile
}

autowhile.d(7): expression expected, not 'auto'
autowhile.d(7): found 'a' when expecting ')'
autowhile.d(7): found '=' instead of statement
autowhile.d(8): unrecognized declaration

This is clearly inconsistent, so logged as a bug and not an enhancement.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to