Skip to content

Fix missing reference conversion case #1058

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

Merged
merged 8 commits into from
Jan 18, 2020
Merged

Fix missing reference conversion case #1058

merged 8 commits into from
Jan 18, 2020

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Jan 15, 2020

We were missing a diagnostic for conversions involving references, where an explicit conversion would pick up a pointer and convert it without complaining. This adds the diagnostic, but doesn't yet attempt to make string to number conversions more convenient (than parseInt).

Related: nearprotocol/near-runtime-ts#108

@dcodeIO
Copy link
Member Author

dcodeIO commented Jan 15, 2020

Last commit implements special code for the reference case and also inserts a runtime check when casting from a nullable to a non-nullable type that the compiler cannot prove to be correct. However, by moving this there's also the case of upcasting that must be handled with a runtime check I guess.

@MaxGraey
Copy link
Member

It also relate to #234

@dcodeIO dcodeIO merged commit 74e0178 into master Jan 18, 2020
@dcodeIO dcodeIO deleted the fix-ref-conv branch March 15, 2020 13:35
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

Successfully merging this pull request may close these issues.

2 participants