STRICT¶
Error types are not considered equal to or subtypes of any other type.
STRICT is the default policy for the following reasons:
-
In general, considering an error type equal to all other types is unintuitive. It essentially turns error types into dynamic
AnyorNothingtypes (depending on the typing position). This can produce a lot of typing relationships which do not make any sense, such asInt = UnresolvedClass. -
It forces the user to handle error types explicitly, which reduces the risk of false positives.
-
It is consistent with most of the behavior of the Kotlin compiler.