[Issue 23983] Better error message when brace missing after `else`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 12 21:13:22 UTC 2023


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

--- Comment #5 from ryuukk_ <ryuukk.dev at gmail.com> ---
> A human could guess the problem is at line 8, but formally, the else branch is not required to have braces, and the } after the else branch could close the main function. 

You don't understand, let me bring you my project and the problem that led me
to create this issue

https://gist.github.com/ryuukk/a4580ef154bf7801670e02a13f760858


```
projects/game/context.d(566,1): Error: unmatched closing brace
```


Try to find where the problem is



> I understand and agree, I'm just wondering how the compiler could algorithmically find out the problem is likely at line 8. Perhaps it could take note of the mismatched indentation of the closing brace after else, and report that once it encounters a missing brace error.

I don't know, i am not a compiler developer, my role is to report issues i
encounter

--


More information about the Digitalmars-d-bugs mailing list