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

No error when closure doesn't return a value #2228

Closed
eladb opened this issue Apr 24, 2023 · 1 comment
Closed

No error when closure doesn't return a value #2228

eladb opened this issue Apr 24, 2023 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@eladb
Copy link
Contributor

eladb commented Apr 24, 2023

I tried this

bring cloud;

resource WebHook {
  api: cloud.Api;

  init() {
    this.api = new cloud.Api();
    this.api.post("/", inflight (req: cloud.ApiRequest): cloud.ApiResponse => {
      log(Json.stringify(req));
    });
  }
}

I expected this:

A compiler error that tells me that the inflight closure must return a value of type cloud.ApiResponse

Instead, this happened

No error

Is there a workaround?

N/A

Component

Compiler

Wing Version

No response

Wing Console Version

No response

Node.js Version

No response

Platform(s)

No response

Anything else?

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@eladb eladb added the 🐛 bug Something isn't working label Apr 24, 2023
@staycoolcall911
Copy link
Contributor

This seems to be a duplicate of #457

@staycoolcall911 staycoolcall911 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants