Paul Berry

Results 149 comments of Paul Berry

@eernstg asked: > @stereotype441, what's your take on the indirect consequences of promoting `this`? We have some direct consequences which are exactly the same as what we would have by...

Yeah, when we implemented null safety we added the requirement that anything being thrown must be assignable to `Object` (i.e. non-nullable). It would have made sense to change the context...

@lrhn > The RHS of `==` seems to be `dynamic`/`_`, not parameter type of LHS's `operator==` made nullable. That's probably a bug. FWIW, I filed an issue about this earlier...

I [prototyped this](https://dart-review.googlesource.com/c/sdk/+/371982) and ran it through a full round of testing in google3. There were no failures, so I'm inclined to move forward on this using the breaking change...

Fixed by https://github.com/dart-lang/sdk/commit/8e8a013baead4a5b6b4dfbfd538202a75d5b3c20.

> What I really don't want is users to end up preferring to jam switch expressions into statement contexts just to get tighter exhaustiveness checking like your second example: >...

@eernstg > However, I'm not quite sure why we need this: > > > an irrefutable pattern match never promotes the type of the scrutinee _itself_. > > If the...

@lrhn > Should the implicit downcast promote too? > > (Why not? The cast is there, and the author just uses a feature that allows it to be implicit.) I...

Based on the conversations above, I see several options for how we might move forward: 1. Don't change the current status quo. Type tests implied by refutable patterns can cause...