Hello!
Since my last update I created 2 pull requests for new visitors:
And did some refactoring for static_if_else
Also created these pull requests in dmd
adding isStaticIfCondtion
method, and fixing
a minor bug in TemplateDeclaration
constructor in ASTBase
I also encountered some difficulties for 2 particular checks:
- I think I already mentioned this a while back but still I didn't manage to get it straight so I am mentioning this again. This is a visitor that checks if a variable name shadow another variable from an outer scope. The problems come from
static if
andversion
conditions, as these do not introduce a new scope, and for me at least it is not yet 100% clear how to treat them, as things get really complicated when we have manystatic if
mixed withversion
. Here is an example of "troublesome" code for this check:
void f()
{
version (Windows)
int a;
static if (true)
version (POSIX)
int a;
else
int b;
}
My implementation would wrongly issue a warning in this scenario. If anyone would have any suggestions on how to go about this it would be awesome.
This is the pr where I tried a few different implementations for that. Feel free to leave a comment :)
- Second issue I ran into would be regarding
@property
functions with no arguments that should be markedconst
. In order not to extend this post even more please check this out for more explanations regarding why that check could be problematic.
Thank you!