Virtual & Pure methods macros raises an error if concrete method exists #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #3 (If virtual or pure_virtual is declared in a class that already has a concrete implementation, raise an error)
Current Behavior
It is possible to inadvertently overwrite a concrete implementation with a virtual method:
In the example, the concrete implementation of
some_methodfromSomeModulewill be overwritten byvirtual :some_methodfromSomeOtherModule.This always results in a malfunction, since the method being overwritten is the virtual method's concrete implementation. The
protocolmacro was added to address this circumstance, but the lack of an error when using thevirtualandabstractmacros remains a problem.Proposed Behavior
The
virtualandpure_virtualmacros raise an error if a concrete implementation exists. The error message includes the source location of the concrete implementation.