1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Fix + operator overloading

This commit is contained in:
Étienne Fildadut 2021-04-04 20:29:22 +02:00
parent ec18d2e611
commit 9028970440
3 changed files with 14 additions and 12 deletions

View file

@ -133,12 +133,14 @@ functions = {
-- arithmetic
["+"] = {
{
arity = 2, types = { "number", "number" }, return_type = "number",
value = function(a, b) return a + b end
},
{
arity = 2, types = { "string", "string" }, return_type = "string",
value = function(a, b) return a .. b end
arity = 2,
value = function(a, b)
if type(a) == "string" then
return a .. b
else
return a + b
end
end
}
},
["-"] = {