You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Special-case type inference of empty collections (#16122)
Fixes#230Fixes#6463
I bet it fixes some other duplicates, I closed couple yesterday, but
likely there are more.
This may look a bit ad-hoc, but after some thinking this now starts to
make sense to me for two reasons:
* Unless I am missing something, this should be completely safe.
Special-casing only applies to inferred types (i.e. empty collection
literals etc).
* Empty collections _are_ actually special. Even if we solve some
classes of issues with more principled solutions (e.g. I want to re-work
type inference against unions in near future), there will always be some
corner cases involving empty collections.
Similar issues keep coming, so I think it is a good idea to add this
special-casing (especially taking into account how simple it is, and
that it closer some "popular" issues).
0 commit comments