Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow accessing function return value inside modifiers #2105

Closed
rainbreak opened this issue Mar 31, 2017 · 4 comments
Closed

Allow accessing function return value inside modifiers #2105

rainbreak opened this issue Mar 31, 2017 · 4 comments
Labels
closed due inactivity The issue/PR was automatically closed due to inactivity. language design :rage4: Any changes to the language, e.g. new features stale The issue/PR was marked as stale because it has been open for too long.

Comments

@rainbreak
Copy link
Contributor

Allow the following:

modifier check {
    var ret = _;
    do_something_with(ret);
}

This is closely related to #49, but doesn't change the function return value.

@lastperson
Copy link
Contributor

You can achieve this already through some trickery, check out this:
https://github.com/ChronoBank/SmartContracts/blob/master/contracts/ChronoBankAssetWithFee.sol#L25
_success[0] is the return value of the function.

@axic axic added the feature label Sep 18, 2017
@axic axic added the language design :rage4: Any changes to the language, e.g. new features label Jul 28, 2018
@martasaparicio
Copy link

martasaparicio commented Jul 17, 2020

Hi there. I'm writing a Smart Contract that follows the StateMachine and AccessRestriction common patterns of Solidity for my thesis.
I have this code:

function nextStage() internal { stage = Stages(uint(stage) + 1); } 
modifier transitionNext() { _; nextStage(); } 
function rq_rentalCompleting() transitionNext { if(true){return true;} else {return false;} }

So I would like to know if i can in same way get the retruned value of rq_rentalCompleting on the modifier transitionNext so i can change his behaviour accordingly on the nextStage function?
The link @lastperson shared is not working for me...

Thank you :)

@github-actions
Copy link

This issue has been marked as stale due to inactivity for the last 90 days.
It will be automatically closed in 7 days.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Feb 12, 2023
@github-actions
Copy link

Hi everyone! This issue has been automatically closed due to inactivity.
If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen.
However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.

@github-actions github-actions bot added the closed due inactivity The issue/PR was automatically closed due to inactivity. label Feb 20, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed due inactivity The issue/PR was automatically closed due to inactivity. language design :rage4: Any changes to the language, e.g. new features stale The issue/PR was marked as stale because it has been open for too long.
Projects
None yet
Development

No branches or pull requests

5 participants