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

Cannot capture reassignable field api.url from inflight #2233

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

Cannot capture reassignable field api.url from inflight #2233

eladb opened this issue Apr 24, 2023 · 1 comment
Assignees
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler

Comments

@eladb
Copy link
Contributor

eladb commented Apr 24, 2023

I tried this

bring cloud;

resource MyResource {
  api: cloud.Api;

  init() {
    this.api = new cloud.Api();
  }

  inflight foo() {
    log(this.api.url);
  }
}

I expected this:

To work

Instead, this happened

   |         ^^^^^^^^^^^^ Cannot capture reassignable field 'url'

Is there a workaround?

I tried to assign url in preflight but ran into #2232

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
@Chriscbr
Copy link
Contributor

Fixed by #2121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler
Projects
Archived in project
Development

No branches or pull requests

2 participants