Skip to content

Allow typed functions in type expressions#1620

Merged
markwpearce merged 14 commits intorokucommunity:v1from
markwpearce:allow_typed_functions_in_type_expressions
Feb 22, 2026
Merged

Allow typed functions in type expressions#1620
markwpearce merged 14 commits intorokucommunity:v1from
markwpearce:allow_typed_functions_in_type_expressions

Conversation

@markwpearce
Copy link
Collaborator

  • Allows syntax like:
sub useCallBack(callback as function(name as string, num as integer) as string)
    print "Result is: " + callback("hello", 7)
end sub
  • Adds validation on typed functions used as arguments
  • Provides better hovers for typed functions
  • Fixes some issues with using Type statements
  • Adds docs
image image

@markwpearce markwpearce added this to the v1.0.0 milestone Feb 11, 2026
…atability of optional args in a typed function type
@luis-j-soares luis-j-soares self-requested a review February 20, 2026 17:39
Copy link
Collaborator

@luis-j-soares luis-j-soares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still trying to nail down how the entire type system works, but fwiw it looks good, and works without issue from the little I tested on my project.

A potential gap is recursive function types, which is not reflected in the tests. Also an outdated example in the docs.

Co-authored-by: Luis Jacobetty Soares <57358121+luis-j-soares@users.noreply.github.com>
@markwpearce
Copy link
Collaborator Author

Still trying to nail down how the entire type system works, but fwiw it looks good, and works without issue from the little I tested on my project.

A potential gap is recursive function types, which is not reflected in the tests. Also an outdated example in the docs.

Good point! I'll add a test to show this.

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! The tests really seem to cover all the bases. Fantastic work! Feel free to merge once you're done making changes.

@markwpearce markwpearce merged commit fd4d8c4 into rokucommunity:v1 Feb 22, 2026
8 checks passed
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.

3 participants