Re: [PATCH] setmetatable({}) causes error
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [PATCH] setmetatable({}) causes error
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2017年7月13日 09:32:04 -0300
> I noticed that setmetatable({}, nil) works normally, but setmetatable({})
> causes an argument type error. This patch fixes the error and restores
> expected behavior.
What is the expected behavior? The signature of setmetatable is
setmetatable(v,t); it sets the setmetatable of v to t or removes the
setmetatable of v if t is nil. Allowing v to be omitted is confusing.