PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org/docs/Introduction
MIT License
338 stars 20 forks source link

Walrus operator method call #815

Closed Sainan closed 2 months ago

Sainan commented 2 months ago

The following code is no longer valid on main but was valid on 0.9.0:

local class Obj
    function isValid()
        return true
    end
end

local function getobj()
    return new Obj()
end

if (inst := getobj()):isValid() then
    print(inst)
end