Just trolling, but that's why in Go, type casts also return a boolean for you 
to check, and since it's a tuple result, you have to handle it instead of 
chaining your value to something else. Couldn't this be implemented in a macro 
returning an `Option[X]`?
    
    
    type X = enum
      Z
    
    var a = 42
    var b = a.toEnum(X)
    if b.isSome:
      # use b
    
    
    Run

Reply via email to