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

Unable to convert a recursive struct from JSON #7126

Open
eladb opened this issue Sep 14, 2024 · 0 comments
Open

Unable to convert a recursive struct from JSON #7126

eladb opened this issue Sep 14, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler

Comments

@eladb
Copy link
Contributor

eladb commented Sep 14, 2024

I tried this:

struct Node {
  id: str;
  children: Map<Node>?;
}

Node.fromJson({
  id: "foo",
  children: {},
});

This happened:

undefined:1


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at compileForPreflight (/Users/eladb/.bun/install/global/node_modules/@winglang/compiler/dist/index.js:454:28)
    at async Object.compile (/Users/eladb/.bun/install/global/node_modules/@winglang/compiler/dist/index.js:339:37)
    at async recompile (/Users/eladb/.bun/install/global/node_modules/@wingconsole/server/dist/index.js:44724:56)

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

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 Sep 14, 2024
@monadabot monadabot added this to Wing Sep 14, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Sep 14, 2024
@Chriscbr Chriscbr added the 🛠️ compiler Compiler label Sep 18, 2024
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
Status: 🆕 New - not properly defined
Development

No branches or pull requests

2 participants