WheretIB / LuaDkmDebugger

Visual Studio C++ debugger extensions for Lua
MIT License
81 stars 32 forks source link

The scope of a local variable #16

Closed czlc closed 2 years ago

czlc commented 3 years ago

local i = 1 do local i = 3 print(i) -- debugger show i is 1 end

WheretIB commented 3 years ago

Fix for issue has been implemented, when inner 'i' comes into scope it will 'shadow' the outer 'i'. This will be included in the next release.

Note: hover will display '3' when hovering over both variables while on the print statement because inner local shadows the outer one and the value evaluation doesn't support the location of the mouse. Visual Studio 'Locals' panel can be used to see both variables.

WheretIB commented 2 years ago

Fixed in 852d72ae8b3d63002a855f0af607c94f36412442 Released in https://github.com/WheretIB/LuaDkmDebugger/releases/tag/v0.9.9