-
Notifications
You must be signed in to change notification settings - Fork 201
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
can't wrap function in function - unknown symbol "this" #5065
Comments
but might be related to
Looks a bit similar to #3717 but this might be a coincidence |
Hi, This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. |
The example in the original issue compiles and works now. However, the alternate case where you write the code as a static method (instead of a free-floating function) causes a runtime error: bring cloud;
class A {
pub static authenticatedMiddleware(handler: inflight (cloud.ApiRequest): cloud.ApiResponse): inflight (cloud.ApiRequest): cloud.ApiResponse {
let middleware = inflight (req: cloud.ApiRequest): cloud.ApiResponse => {
return handler(req);
};
return middleware;
}
}
let api = new cloud.Api();
api.get("/hello", A.authenticatedMiddleware(inflight (req) => {
return { status: 200 };
})); |
Fixed in #6040, closing. |
I tried this:
see playground
This happened:
I expected this:
no error
Is there a workaround?
No response
Anything else?
Perhaps related to this, but I'm not sure #4993
Wing Version
0.50.6
Node.js Version
18.7
Platform(s)
MacOS
Community Notes
The text was updated successfully, but these errors were encountered: