ldoc
ldoc copied to clipboard
Mixing self and colon notation in methods
trafficstars
When a method has only one parameter (self), it is being displayed explicitly in the argument list and with the object notation. This combination is an invalid syntax. The test case below demonstrates the problem:
-------------------------------------------------
-- @module ex
-------------------------------------------------
-------------------------------------------------
-- @type Example
-------------------------------------------------
local Example = {
-------------------------------------------------
-- function 1
-------------------------------------------------
one = function(self)
return
end,
-------------------------------------------------
-- function 2
--
-- @param param1
-- @param param2
-------------------------------------------------
two = function(self, param1, param2)
return
end,
}
This generates the following documentation:

Example:one(self) is incorrect.
This seems the same problem as one of the issues in #111 .
Related to (but not the same) as #249.