-
Notifications
You must be signed in to change notification settings - Fork 15
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 transforming local function without putting restriction on the wrapping function #16
Comments
That means we'd have to check all expressions of every method to see if it contains the metadata. But if this is something you regularly need, we could enable it behind a flag and see how it goes? |
Or introducing another meta besides |
That's what @:await
class Await {
@:await function wrapper() {
@:async function local() {
return @:await something();
}
// ... use local ...
}
} |
Oh I thought |
It doesn't :) It works as you proposed:
I've added a test here, but let's keep this open so I can add some info in the docs. I didn't before because I wasn't sure about the name (as @:await now has a different meaning on either class/method/expr). But after this time I don't think I'm going to come up with something better :) |
Oh, wait I spoke too soon. A method marked @:await does force its return type to |
So, this works: @:await function wrapper() {
@:async function local() {
return @:await something();
}
return whatever;
} But, this doesn't: @:await function wrapper() {
@:await something();
return whatever;
} Because it cannot get transformed to something that makes sense. |
Ok, then great. And the |
I would like to do this:
Note that wrapper is not tagged by
@:await
nor@:async
The text was updated successfully, but these errors were encountered: