mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG] Adding "nodebug" change runtime behaviour

Open soraros opened this issue 10 months ago • 9 comments

Bug description

As title. If I understand correctly, the following should be equivalent:

# two-branches
@parameter
if cond:
  return body_true()
else:
  body_false()

# guard
@parameter
if cond:
  return body_true()
body_false()

However, it appears to not be the case, as can be seen in #2220. Content of the consecutive commits in #2220:

  1. b45ed87 (two-branches) has a function with a @parameter if with two branches. CI passes.
  2. d8df28d (guard) made the above mentioned mechanical change, and CI check fails.
  3. cb040c4a (nonodebug) removes "nodebug" from the offending function found in guard, and CI passes again.

Steps to reproduce

I can't manage to reduce the repro further, so I created #2220 and #2222 to use CI to show the problem.

System information

Mojo nightly

soraros avatar Apr 06 '24 15:04 soraros