Try typing in --!strict at the start of your code, or create a type reference for your table:
--!strict
type _someObject = {
Name: string
}
local module = {}
module.__index = module
function module.new()
local self: _someObject = setmetatable({}, module)
self.Name = "asgm"
return self
end
function module:Clone()
local new = module.new()
for k, v in pairs(self) do
new [k] = v
end
return new
end
local someObject = module.new()
local newObject = someObject:Clone()
someObject.Name = "asgm"
I don’t have studio with me right now so I have no way of testing this out.