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
Since halt doesn't return, it should return Nothing. This can be accomplished by throwing the result of java's halt (it won't actually get thrown because java's halt will do it first).
This will let us use halt inside of when and the like without affecting the type of the expression. (right now, since halt returns the exception, a when statement will change its type to Any for no good reason)
The text was updated successfully, but these errors were encountered:
On another note, could we have HaltException extend Exception instead of RuntimeException, so the compiler can smart-cast T? objects to non-nullable T objects in some places
ex:
val x :Int?=nullif(x ==null)
halt(400,"x is null")
x.toString()//and other methods, because x is of type Int not Int?```
Since
halt
doesn't return, it should return Nothing. This can be accomplished by throwing the result of java's halt (it won't actually get thrown because java'shalt
will do it first).This will let us use halt inside of
when
and the like without affecting the type of the expression. (right now, since halt returns the exception, awhen
statement will change its type to Any for no good reason)The text was updated successfully, but these errors were encountered: