ldoc icon indicating copy to clipboard operation
ldoc copied to clipboard

Mixing self and colon notation in methods

Open PedroAlvesV opened this issue 8 years ago • 1 comments
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: selection_002

Example:one(self) is incorrect.

This seems the same problem as one of the issues in #111 .

PedroAlvesV avatar Jan 11 '17 16:01 PedroAlvesV

Related to (but not the same) as #249.

alerque avatar May 04 '23 20:05 alerque