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

Unwrap-or operator doesn't allow optional in second position #1845

Closed
Chriscbr opened this issue Mar 17, 2023 · 1 comment
Closed

Unwrap-or operator doesn't allow optional in second position #1845

Chriscbr opened this issue Mar 17, 2023 · 1 comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler

Comments

@Chriscbr
Copy link
Contributor

Community Note

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.

I tried this:

bring cloud;

let x: num? = 5;
let y: num? = 10;
let z = x ?? y;

I expected this:

It compiles, and z will be type num?

Instead, this happened:

error: Expected type to be "num", but got "num?" instead
  --> test.w:5:14
  |
5 | let z = x ?? y;
  |              ^ Expected type to be "num", but got "num?" instead

Component:

Compiler

Wing Version:

0.5.139

Node.js Version:

18.12.1

Platform(s):

MacOS

Anything else?

No response

@Chriscbr Chriscbr added 🐛 bug Something isn't working 🛠️ compiler Compiler labels Mar 17, 2023
@Chriscbr Chriscbr changed the title Optional unwrap-or operator doesn't allow optional in second position Unwrap-or operator doesn't allow optional in second position Mar 17, 2023
@Chriscbr
Copy link
Contributor Author

Closing as duplicate of #1875

@Chriscbr Chriscbr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 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 🛠️ compiler Compiler
Projects
Archived in project
Development

No branches or pull requests

1 participant