Closed
Conversation
While Class::Method::Modifiers is primarily meant to wrap methods, it can also be used to wrap functions. Functions may have prototypes, so it would be better if they could maintained in the wrapper. This works similarly to the lvalue attribute. If a before or after is applied, the wrapper takes its prototype from the sub being wrapped. If an around is applied, the modifier sub's prototype is used. This is rather strange for arounds, as the parameters it is passed will still include the wrapped sub as the first parameter, so the parameters won't match the prototype exactly. Even with that oddness, it still seems to be the best option. This also means an around could change the prototype, which will throw warnings.
Member
|
Since I created my PR, Test::Fatal and Test::Warnings were intentionally dropped as prereqs, so we don't want to reintroduce them. I've rebased my PR #6, updating it to avoid Test::Fatal and Test::Warnings, and integrating the additional testing you wrote here (but also updated to avoid Test::Warnings). Thanks. |
Author
|
Makes sense, closing as a result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a
git rebaseand caught updist.iniof #6 by @haarg which is a few years old now.I added some additional checks in the test file including
aroundfor an XS sub.