LENIENT¶
Error types are equal to and subtypes of all types.
LENIENT should be chosen if type errors are expected and should be treated as type holes that can be satisfied by any other type. However, caution should be applied when using LENIENT, as the policy can swallow type errors which should have been dealt with explicitly. In most cases, explicit type error handling should be preferred.
As a motivating example, consider that we want to find all functions which can be called with an argument of a certain type and show them to a user. The user has provided a type List<> with an unspecified type argument, which translates to List<ERROR>. We still want to show functions like foo(list: List<Int>), as the user hasn't filled out the type argument yet. With the LENIENT policy, List<ERROR> is a subtype of List<Int>, meaning that foo(list: List<Int>) is a valid candidate for our purposes.