Closed ketrab2004 closed 1 year ago
In regular lua this would error but in luau this works just fine.
That isn't true for your code in specific. Luau doesn't change this behavior at all.
That being said, you are roughly right about the bug, this is a duplicate of #212
That is odd, because for me in 5.4 and 5.3 it does error, but not with luau.
input:1: attempt to call a nil value (global 'doSomething')
Oh nevermind, my minimal reproducible example is wrong.
function main()
doSomething()
end
function doSomething()
print("something")
end
main()
When using a function before it's defined it thinks that it isn't used.
In regular lua this would error but in luau this works just fine.