[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Special do/end block that raises an error on free names - Proof of concept
- From: Sergey Kovalev <kovserg33@...>
- Date: Mon, 22 Jul 2019 18:33:54 +0300
пн, 22 июл. 2019 г. в 18:18, Coda Highland <firstname.lastname@example.org>:
> 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
function fn(G,z) pure
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.