AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
10 stars 3 forks source link

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

Closed dbenn closed 1 month ago

dbenn commented 1 month ago

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 commented 1 month ago

Also need to handle real and integer conversion to string.

dbenn commented 1 month ago

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 commented 1 month ago

Fixed now