Closed ZeeD closed 2 years ago
Unfortunately, this is actually by design. This is functionally no different than doing:
function name(name)
' which variable are you referencing? Depending on the thread and sg version and whether you've shown the scene yet, it could be either the local var OR the function
print name
end function
Until we add some type of case-sensitive transpile mode, variables cannot have the same name as any classes/interfaces/namespaces/functions/enums/consts .
Oh. OK.
FWIW: more than case-sensitivity I was hoping that bsc
could transparently add some name mangling (fox example adding some prefixes/suffixes) to disambiguate these scenarios, but I can add them myself in this specific case.
Oh. OK.
FWIW: more than case-sensitivity I was hoping that
bsc
could transparently add some name mangling (fox example adding some prefixes/suffixes) to disambiguate these scenarios, but I can add them myself in this specific case.
I would love to see BrighterScript support this type of functionality in the future! If you're interested, we'd gladly welcome a PR that adds this functionality.
snippet:
bsc
returns this error:error BS1106: Local variable has same name as class 'Name'
(using
brighterscript
0.55.1
)