dmd/changelog/dmd.get-is-virtual-function.dd

11 lines
826 B
Text

Deprecate `traits(isVirtualFunction)` and `traits(getVirtualFunctions)`
Up until this release, D had both `traits(isVirtualFunction)` and `traits(isVirtualMethod)`
(and their coressponding `traits(get...)` counterpart). The differenrcte between the two is
that `isVirtualFunction` returns true for `final` methods that do not override anything. This
is in contradiction with the D spec which states that `final` functions that do not override
other functions cannot be virtual. `isVirtualMethod` correctly returns `false` in that case.
Starting with this release, both `traits(isVirtualFunction)` and `traits(getVirtualFunctions)`
are deprecated. If the behavior of `traits(isVirtualFunction)` is desired, it can be achieved by
`traits(isVirtualMethod, f) || (traits(isFinalFunction, f) && !traits(isOverrideFunction, f))`.