adbf363009
As discussed in https://github.com/dart-lang/language/issues/2857#issuecomment-1458522087, we only want a pattern match to promote the scrutinee in refutable contexts (if-case and switch). Bug: https://github.com/dart-lang/language/issues/2857, https://github.com/dart-lang/sdk/issues/50419 Change-Id: I187ef632e5da95b931e5cda34db06491a5228c98 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288000 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Paul Berry <paulberry@google.com>