You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question here... we've got an independent Roku library that we are compiling with the brightscript compiler. Unfortunately this has some legacy .brs files in it, and those .brs files are calling bslib_ternary() directly (as opposed to a .bs file that can use the ternary syntax sugar).
This used to just work fine, but on the latest compiler version, it produces the error:
132:11 - error BS1140: Cannot find function 'bslib_ternary'
(This makes total sense, as nothing about this build would indicate the function should exist! It just happens to work, because when we build our application and include this library, the bslib_ternary function is already globally available.)
Is there a supported way to "declare" somewhere in the file that "bslib_ternary" will be available at runtime? Or is the best I can do to suppress these errors is inserting a line comment 'bs:disable-next-line?
The text was updated successfully, but these errors were encountered:
Since v0.67.0, we separated "can't find variable" and "can't find function" into separate diagnostics. It's possible your codebase was already ignoring bs1001, and now need to ignore bs1140 instead for this situation (either in 'bs:disable-line comments or in bsconfig.json diagnosticFilters).
You can ignore specific error codes for a library by using the bsconfig.jsondiagnosticFilters collection. Something like this:
{"diagnosticFilters": [{//ignore ALL diagnostics from vendor libraries. (or add a "codes" section to ignore specific codes)"src": "vendor/**/*"}]}
We don't currently have a way to declare that some function will be available globally. Would be a nice enhancemet eventually, I envision there being some type of global.d.bs file you could specific somewhere with extra syntax to do that. We just haven't gotten a chance to think through some of that.
Question here... we've got an independent Roku library that we are compiling with the brightscript compiler. Unfortunately this has some legacy .brs files in it, and those
.brs
files are callingbslib_ternary()
directly (as opposed to a.bs
file that can use the ternary syntax sugar).This used to just work fine, but on the latest compiler version, it produces the error:
(This makes total sense, as nothing about this build would indicate the function should exist! It just happens to work, because when we build our application and include this library, the
bslib_ternary
function is already globally available.)Is there a supported way to "declare" somewhere in the file that "bslib_ternary" will be available at runtime? Or is the best I can do to suppress these errors is inserting a line comment
'bs:disable-next-line
?The text was updated successfully, but these errors were encountered: