1b2c267bb2
Previously to unwrap a type in isTop method the declared nullability was set to Nullability.nonNullable. This doesn't work for intersection type because .withDeclaredNullability() doesn't work for them. This CL introduces a method that simulates the removal of the top-level nullability type constructor from a type term, and uses the method in isTop to account for intersection types and other possible similar cases in future. Change-Id: I3e6f30b5d93850b2cf92475a89d09d6d9255089f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156193 Reviewed-by: Johnni Winther <johnniwinther@google.com>