Quantcast ESOUI - View Single Post - Eclipse LDT autocompletion
View Single Post
11/04/18, 09:51 AM   #6
cloudor
 
cloudor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 10
By default luadoc convention, function definitions can not be used as type directly, you need to link them by callof annotation.

Lua Code:
  1. ---
  2.     [email protected] StringProvider
  3.    
  4.     ---
  5.     -- @callof #StringProvider
  6.     -- @return #string
  7.     local function MyStringProvider()
  8.         return ""
  9.     end
  10.  
  11.     --- @param #StringProvider stringProvider
  12.     local f = function(stringProvider)
  13.         return function(n)
  14.             local s = stringProvider()
  15.             return n == s:l
  16.         end
  17.     end

Last edited by cloudor : 11/04/18 at 09:55 AM.
  Reply With Quote