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

ConditionalExpressions must return a consistent type #22

Open
MichaelBuhler opened this issue Jul 19, 2023 · 0 comments
Open

ConditionalExpressions must return a consistent type #22

MichaelBuhler opened this issue Jul 19, 2023 · 0 comments

Comments

@MichaelBuhler
Copy link
Owner

JS:

val ? 123 : 'abc'

Transpiles to:

_test(scope->*"val") ? make_shared<Number>(123) : make_shared<String>("abc");

producing a C++ compilation error about how the Number and the String are not consistent types.

The transpiler needs to check the types to convert them either/both to shared_ptr<Value> if neccessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant