If you add `{.compileTime.}` to the proc, the exception doesn't get tracked as 
it would be a compile error.
    
    
    from std/parseutils import parseUInt
    
    type flg = distinct uint8
    
    proc `'flg`*(n: string): flg {.compileTime.} =
      var number: uint
      discard parseUInt(n, number)
      result = number.flg
    
    proc main {.raises: [].} =
      let x = 0'flg # no error
    
    
    Run

IMO this is the best way to use this feature. The only reason string is used 
for these is to support huge numbers.

Reply via email to