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

compiler/checker: fix call to 'setValue' #925

Merged
merged 1 commit into from
Dec 13, 2021
Merged

compiler/checker: fix call to 'setValue' #925

merged 1 commit into from
Dec 13, 2021

Conversation

zapateo
Copy link
Member

@zapateo zapateo commented Dec 13, 2021

Currently, when assigning a value of a type T1 to a variable of type T2,
if such assignment requires an implicit conversion then such conversion
is performed at runtime, calling the 'OpConvert'.

This is not correct and leads to problems.

This commit avoids that by calling 'setValue' passing it the correct
type instead of nil, so the conversion is performed at compile time.

Fix #917.

Co-authored-by: Marco Gazerro gazerro@open2b.com

Currently, when assigning a value of a type T1 to a variable of type T2,
if such assignment requires an implicit conversion then such conversion
is performed at runtime, calling the 'OpConvert'.

This is not correct and leads to problems.

This commit avoids that by calling 'setValue' passing it the correct
type instead of nil, so the conversion is performed at compile time.

Fix #917.

Co-authored-by: Marco Gazerro <gazerro@open2b.com>
@zapateo zapateo changed the title runtime: fix conversion between integers and complex types compiler/checker: fix call to 'setValue' Dec 13, 2021
@zapateo zapateo removed the request for review from gazerro December 13, 2021 14:56
@zapateo zapateo merged commit 42d7c42 into main Dec 13, 2021
@zapateo zapateo deleted the fix-917 branch December 13, 2021 14:58
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.

Invalid behaviour with complex variables
1 participant