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

Actual integer function parameter not being coerced in the presence of a real parameter? #440

Closed
dbenn opened this issue Jul 9, 2024 · 3 comments · Fixed by #444
Closed
Assignees
Labels
bug Something isn't working VeLa VStar expression Language

Comments

@dbenn
Copy link
Collaborator

dbenn commented Jul 9, 2024

The following:

f(x:real) { x*x }

f(4)

yields:

F (REAL) has no return type but a value of type INTEGER was returned.

Since the actual parameter 4 should have been coerced from an integer into a real, the message should be:

F (REAL) has no return type but a value of type REAL was returned.

This suggests a problem with type coercion from actual to formal parameters.

@dbenn dbenn added bug Something isn't working VeLa VStar expression Language labels Jul 9, 2024
@dbenn dbenn self-assigned this Jul 9, 2024
@dbenn
Copy link
Collaborator Author

dbenn commented Jul 11, 2024

Also need to handle real and integer conversion to string.

dbenn added a commit that referenced this issue Jul 12, 2024
…; added conversion of bool, int, real to string function params
@dbenn
Copy link
Collaborator Author

dbenn commented Jul 13, 2024

I think I may be mutating actual parameters (which could be bound to variables) in the process of type conversion. Will test and confirm including adding a regression test.

Need to copy operands on mutation and replace in the actual parameter list.

dbenn added a commit that referenced this issue Jul 13, 2024
…erand (original or modified) and changed calling code to accommodate; added a UT to check that parameter conversion does not change actual parameter
@dbenn
Copy link
Collaborator Author

dbenn commented Jul 13, 2024

Fixed now

dbenn added a commit that referenced this issue Jul 14, 2024
…ter-not-being-coerced-in-the-presence-of-a-real-parameter

#440: ensured that converted operand is returned and fixed UT results…
@github-project-automation github-project-automation bot moved this from To do to Done in VStar Development Issues Jul 14, 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 VeLa VStar expression Language
Projects
Development

Successfully merging a pull request may close this issue.

1 participant