> So nim doesn't know that the Some(_) and None() branches form an exhaustive 
> check of Option values?

Well it's cause the macro expands the case statement into if elif branches this 
can be seen in the following.
    
    
    # compile with --expandMacro: case
    {.experimental: "caseStmtMacros".}
    
    import fusion/matching
    
    let a =
      case some(0)
      of Some(_): 1
      else: 2
    
    echo a
    
    let b =
      case some(3)
      of Some(_): discard 4
      of None(): discard 5
    
    echo b
    
    
    Run

Reply via email to