[Issue 5096] More readable unpaired brace error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 15 03:40:57 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=5096

Adam D. Ruppe <destructionator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator at gmail.com
           Severity|minor                       |enhancement

--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> ---
Just wasted ~ 5 mins due to this.

struct Foo {
        void foo() {
                if(1)
                        assert(0);
                }
        }
}

enhance.d(7): Error: unrecognized declaration


Of course in my real code it reported

terminal.d(1681): Error: unrecognized declaration

turns out on line 943, I wrote `void thing() { if() .... } } `. missing the
opening { on the if


Yes, 700 lines apart in the real thing.


Perhaps you say this belongs in a linter but this could have been detected
perhaps by seeing the close brace isn't on the same indent as its corresponding
open line (not always true but can maybebe worth a warning anyway)

--


More information about the Digitalmars-d-bugs mailing list