Visual Studio function glitch
4 days, 18 hours ago
I was going through the beginning of Day 62 and was baffled as to why my Sword.High entity was returning null pointer. Turns out I was baffled because there was nothing wrong with the code. Visual Studio is doing a weird thing where it's treating an if statement inside a function as scoped, so when the sword leaves that if block, it goes out of scope and the function can't return it.
When I moved
inside the glitching if statement, it worked just as it should. Fortunately, VS isn't doing this anywhere else in the code, just in that one spot. I still want to fix it, though, and reinstalling VS didn't help.
Does anyone have any ideas?
 Visual Studio function glitch
4 days, 18 hours ago Edited by Mārtiņš Možeiko on May 20, 2017, 1:25 a.m.
Are you saying this doesn't work:
But this works:
I'm pretty this is not the issue and reinstalling VS will not help you here at all. There is something else wrong either with your changes or how are you using compiler or debugger.