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

Augments handling of void returns #1380

Open
wants to merge 2 commits into
base: release-1.0.0
Choose a base branch
from

Conversation

markwpearce
Copy link
Collaborator

@markwpearce markwpearce commented Dec 20, 2024

  • Adds isBuiltIn ExtraSymbolData for symbols that are built in types/functions
  • For Built in functions & methods that return as void, return type is void
  • for User defined functions that return as void, the return type is actually invalid
  • Validates against using void-typed vars in Binary expressions and as arguments
  • Changes Binary (and Unary) result type code to be more lenient - if one of the types is dynamic, then it assumes the actual type is something that provides a better result type...

eg.

function test(foo)
   bar = foo + "Hello"
  ' bar is typed as `string`
end function

Addresses #1360

@markwpearce markwpearce added this to the v1.0.0 milestone Dec 20, 2024
@TwitchBronBron
Copy link
Member

This might just be a naming thing, but I'm not sure that void is the right term here? At runtime, it seems that these built-in objects actually return uninitialized instead of void, and the runtime errors are when trying to dereference uninitialized values. So should we align on the term UninitializedType instead of VoidType?

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