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

Function should be allowed as type #177

Closed
triwav opened this issue Feb 25, 2019 · 2 comments · Fixed by #185
Closed

Function should be allowed as type #177

triwav opened this issue Feb 25, 2019 · 2 comments · Fixed by #185
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser

Comments

@triwav
Copy link

triwav commented Feb 25, 2019

If you type a param as Function like here: https://github.com/briandunnington/roku-promise/blob/master/Promise.brs#L40
You receive the warning:
Function parameter 'callback' is of invalid type 'function'

This also seems to mess up subsequent code as I get:
Found unexpected token 'end function'
on the outer function end statement

@TwitchBronBron
Copy link
Contributor

Just to add some clarity, here's a simplified example showing the issue.

image

Source
sub Main()
   doWork = function(callback as function)
   end function
end sub

@sjbarag sjbarag added this to High priority in Issue Triage Feb 26, 2019
@sjbarag sjbarag moved this from High priority to Needs triage in Issue Triage Feb 26, 2019
@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser labels Feb 26, 2019
@sjbarag sjbarag moved this from Needs triage to High priority in Issue Triage Feb 26, 2019
@sjbarag
Copy link
Owner

sjbarag commented Feb 26, 2019

I could have sworn I had a test case that accepted a callback function, but it turns out I never provided as function 😓

Sorry about that @triwav!

sjbarag added a commit that referenced this issue Mar 1, 2019
I'd accidentally allowed "as callable" (the internal name for a
BrightScript function) insntead of "as function".

fixes #177
Issue Triage automation moved this from High priority to Closed Mar 1, 2019
sjbarag added a commit that referenced this issue Mar 1, 2019
I'd accidentally allowed "as callable" (the internal name for a
BrightScript function) insntead of "as function".

fixes #177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser
Projects
Development

Successfully merging a pull request may close this issue.

3 participants