[x] I tested it on latest Nelua version from master branch.
[x] I checked there is no similar issue already reported.
[x] My code has no errors or misuse of Nelua. (well, is a misuse actually)
Bug description
When trying to use a method on variable which the type actually declares, but in this declaration there is no parameters, the Nelua compiler crashes and gives the compiler's traceback instead of giving an error message.
Code example
local R = @record{a: integer}
function R.hello()
print'hello'
end
local x: R = {}
x:hello()
This problem doesn't happens when the : syntax sugar is not used:
local R = @record{a: integer}
function R.hello()
print'hello'
end
local x: R = {}
R.hello(x)
output:
nelua ../teste.nelua
../teste.nelua:8:8: error: in call of function 'R.hello': expected at most 0 arguments but got 1
R.hello(x)
^~~
Expected behavior
An error message is expected, something like the output when not using the : syntax sugar.
Bug description
When trying to use a method on variable which the type actually declares, but in this declaration there is no parameters, the Nelua compiler crashes and gives the compiler's traceback instead of giving an error message.
Code example
This problem doesn't happens when the
:
syntax sugar is not used:output:
Expected behavior
An error message is expected, something like the output when not using the
:
syntax sugar.Environment