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

Fail on ambiguous runtime function resolution without type information #1127

Closed
brynrhodes opened this issue Feb 10, 2023 · 0 comments · Fixed by #1234
Closed

Fail on ambiguous runtime function resolution without type information #1127

brynrhodes opened this issue Feb 10, 2023 · 0 comments · Fixed by #1234

Comments

@brynrhodes
Copy link
Member

By default, ELM does not include type information, requiring the engine to resolve function overloads using runtime typing. However, not all engines perform runtime type resolution of functions, resulting in potentially ambiguous calls at runtime. For example:

define function TestAny(a Integer):
  a

define function TestAny(b String):
  b

define TestAnyFunctionWithInteger:
  TestAny(1)

define TestAnyFunctionWithString:
  TestAny('joe')

With runtime-typing, a correct evaluation is:

TestAnyFunctionWithInteger=1
TestAnyFunctionWithString=joe

The translator currently has options to output signature information (SignatureLevel on function invocations, but given the potential for runtime failure, it should be an error condition if this information is not included when there are potentially ambiguous runtime overloads as in the above example.

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