[SAoC2022] Replace libdparse with dmd-as-a-library in D-Scanner week 3

Lucian Danescu lucidanescu28 at yahoo.com
Sun Oct 9 16:05:32 UTC 2022


Hello!

This week I added initial implementations for the following 
visitor:
[incorrect_infinite_range](https://github.com/Dlang-UPB/D-scanner/pull/26)

Made the additions necessary so that the parser is compatible 
with ASTBase also:
[ErrorExp](https://github.com/dlang/dmd/pull/14520) and
[ErrorStatement](https://github.com/dlang/dmd/pull/14521) and 
completed a pull request
[fixing a location issue](https://github.com/dlang/dmd/pull/14473)

Since the latest pull requests were merged into dmd, I could run 
tests and ran into this
situation:

Let's consider this code

```
static class C
{
     // ...
     final void foo() { ... }
     // ...
}
```

So in D-Scanner we have a check that warns against redundant 
usage of `final` keyword.
`Final` is indeed redundant with static methods, but with the 
current D-Scanner implementation,
in the example above the usage of `final` is not signaled, while 
with my implementation it is.
I would have a question here, and that would be if I should stick 
100% with the current behavior
of D-Scanner, or if I should update the behavior, as I would say 
is the case here, and probably
similar situations will arise in the future.


More information about the Digitalmars-d mailing list