Skip to content

ICE: print(None < Some(1)) — invalid MIR before codegen, "local _2 has ty=117, a generic declaration with no type arguments in main" #2946

Closed

Description

@ehartford

Conformance audit 2026-11-02, probing §10.1/§11.8 (D97: Option is None | Some(T), so None sorts first). Installed compiler (main 038c50c):

print(None < Some(1))
error: internal compiler error: invalid MIR before codegen (a bug in the With compiler, not in this program): local _2 has ty=117, a generic declaration with no type arguments in `main`

With typed bindings (let x: Option[i32] = None; let y: Option[i32] = Some(1); print(x < y)) it compiles. Sema accepted an Option with no type argument into MIR (the D65 class: MIR reported the contradiction correctly; Sema should have typed None from Some(1), or refused with a diagnostic). Route: with analyze repro.w audit:resolution, then --dump-typed.

Activity

  1. added
    bug
    crash
    on Nov 2, 2026
  2. added a commit that references this issue on Nov 7, 2026
  3. ehartford commented on Nov 7, 2026

    @ehartford
    ContributorAuthor

    Fixed in #3056 (merged as afbdbb1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions