735bcbe10d
Fixes #42950 It was previously allowed, though non-sensible, to read `.current` before advancing the iterator for a `RegExp.allMatches` iterable and get `null`. Using `as` allows backward compatibility in unsound null safety mode, while `!` is breaking since it introduces a null check in either mode. The new behavior is also the behavior of the migrated code for DDC since https://dart-review.googlesource.com/c/sdk/+/151121 Change-Id: I9f3654298a3d480ec2f297a40a4145ff6ca9f011 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157880 Auto-Submit: Nate Bosch <nbosch@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Nate Bosch <nbosch@google.com>