[SAoC2022] Replace libdparse with dmd-as-a-library in D-Scanner week 3
user1234
user1234 at 12.de
Sun Oct 9 17:37:55 UTC 2022
On Sunday, 9 October 2022 at 16:05:32 UTC, Lucian Danescu wrote:
> Hello!
>
> [...]
>
> 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.
D-Scanner is right by no signaling anything.
Without `final`, `foo` is virtual. The fact that `C` is static
just means that it cannot read in the parent frame, e.g if
declared inside a function body.
More information about the Digitalmars-d
mailing list