You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codegen BUG on an Option module global read in main: let a: Option[i32] = None + if a.is_none() → "discriminant rvalue 0: place 0 has no type in main" #2976
Found implementing D184 (script bindings become globals); reproduces on main's own compiler (v0.16.0.8-gd2fe55dbf):
let a: Option[i32] = None
fn main:
if a.is_none(): print("none")
error: code generation failed: BUG: discriminant rvalue 0: place 0 has no type in `main`
let a: Option[i32] = None alone, or print(a < b) over two such globals, compiles; the is_none() (a discriminant read of the global's place) in main does not. Route: with analyze repro.w audit:resolution (the operand-type check), then --dump-mir main for the discriminant rvalue's place and --explain-mir-origin. Test behav_d97_option_none_first becomes this shape under D184 and fails on it.
Activity
#3016, #3032, #2946, #2976, #2949, #3051, #3005, #3001, #3017, #2521:…
ehartford commentedon Nov 7, 2026
Fixed in #3056 (merged as afbdbb1).