Maybe it's been fixed

Charles Hixson charleshixsn at earthlink.net
Wed Aug 26 14:27:10 PDT 2009


I was just going over the code for my current project, and I noticed 
that I'd included an enum in it, which wasn't causing any problems.  So 
maybe it's been fixed.  (Also, maybe it's only if you say the compiler 
is D2.x.)

Charles Hixson wrote:
> Ary Borenszweig wrote:
>> Charles Hixson wrote:
>>> Ary Borenszweig wrote:
>>>> Qian Xu wrote:
>>>>> Hi Ary,
>>>>>
>>>>> well done.
>>>>>
>>>>> Here is a small bug report about the code fomatter:
>>>>>
>>>>>
>>>>> =============================
>>>>> import tango.io.Stdout;
>>>>> import tango.core.Exception;
>>>>>
>>>>> void main(char[][] args)
>>>>> {
>>>>>     try
>>>>>     {
>>>>>         /* Do some stuff */
>>>>>     }
>>>>>     catch (IOException ex)
>>>>>     {
>>>>>         Stdout.formatln("Caught IOException!");
>>>>>     /* Consequence: Clean up and possibly try again. */
>>>>>     } catch (Exception ex)
>>>>>     {
>>>>>         Stdout.formatln("Caught unexpected exception!");
>>>>>     /* Consequence: Die as gracefully as possible. */
>>>>>     }
>>>>> }
>>>>> =============================
>>>>>
>>>>> You can see, the first catch-block is placed from a new line, but 
>>>>> the second
>>>>> catch-block is not. Could you please fix this issue?
>>>>>
>>>>> Thanks in advance.
>>>>
>>>> The result I get, with brackets of try/catch/finally configured to 
>>>> the next line, is:
>>>>
>>>> import tango.io.Stdout;
>>>> import tango.core.Exception;
>>>>
>>>> void main(char[][] args) {
>>>>     try
>>>>     {
>>>>         /* Do some stuff */
>>>>     } catch(IOException ex)
>>>>     {
>>>>         Stdout.formatln("Caught IOException!");
>>>>     /* Consequence: Clean up and possibly try again. */
>>>>     } catch(Exception ex)
>>>>     {
>>>>         Stdout.formatln("Caught unexpected exception!");
>>>>     /* Consequence: Die as gracefully as possible. */
>>>>     }
>>>> }
>>>>
>>>> What's your formatter configuration?
>>> Did you notice the line in your example reading:
>>>     /* Consequence: Clean up and possibly try again. */
>>>     } catch(Exception ex)
>>> I think he's saying the catch should have been on a line separate 
>>> from the close bracket.
>>> (I've noticed that I need to do a lot of formatting manually with 
>>> things like:
>>>      if (....)
>>>      {
>>>      {
>>> being common.  I just insert another tab, so it's no big deal, but it 
>>> happens frequently.  (I'd rather that you detected more parsing 
>>> errors rather than spending your time fixing the formatting, but 
>>> other people have other priorities.)
>>> P.S.:  When using descent I've discovered that it's best to avoid 
>>> emuns.  It would be nice if that were fixed.  Using them seems to 
>>> lead to the entire IDE freezing.
>>
>> If you can create a ticket so I can reproduce it, great. :)
> 
> Understanding your problem, I still can't.  I've just stopped using 
> them.  But since the change happened two or three times soon after I 
> inserted enums into a relatively large program, and disappeared when I 
> removed them, I'm rather certain about the cause.  (Often it would 
> freeze the IDE before I'd even saved the work, and when I reproduced it 
> using constant ints of type (whatever) there wasn't any problem.)
> 
> P.S.:  When the problem was present I found it expedient to correct the 
> problem using another text editor.  The IDE would crash that quickly 
> after the file opened.


More information about the Digitalmars-d-announce mailing list