VERY SCARY .NET ISSUE

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I was just debugging some code in studio. Very simple.

If [some expression] then return

It kept returning even though my expression was false. I even checked it in
the command window.

So I simply moved my "return" to another line and it started working.

if [some expression] then
return
end if


That is some major scary stuff. I was doing a DirectCast on an object and
calling it's "equals" method against another object.

if DirectCast(myobj, sometype).equals(myobj2) then return

Not sure if it's a bug or what.
 
Usually when we think its a bug with teh computer or teh
system or the platform, it turns out otherwise :)

Gotta see your code to believe what you are saying.
You may have missed something, Double check.
 
I would feel much better if that were the case, but like I explained , it
was a VERY simple piece of code that evaluatated to "False" in my command
window and then "Then" code went ahead and ran. All I did was move my
conditional code to another line and it worked. Not much to examine there.
 
Did it actually run or just look like it? There have been a few bugs in the
debugger that highlights lines that are actually not executed, which you may
be experiancing.
 
i differ. i haven't seen the full code. it depends on what you were
comparing, what kind of optimization was going on. we must see the full code
which is responsible for the bug. its a must even though it is a trivial 2
or 3 lines. hundreds of bugs can exist in 2 lines of code. ;-)
 
Back
Top