lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

пн, 22 июл. 2019 г. в 18:18, Coda Highland <>:
> Because upvalues are resolved at compile time. They're not free names.
This patch is for compile time checking. Any there is ability to
distinct between local and upvalue. Just look inside lparser.c

> Sadly, this means that this patch really doesn't do much more for you than strict.lua aside from being able to control which blocks it applies to.
That's why I write my own patch for pure function

local y="upvalue"

function fn(G,z) pure
  local a
  function a() G.print(y) end -- here compile error: no access to 'y'

So you know that you are missing "local y" declaration is this scope.