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
this is an except from our tests. All of these comparisons are forbidden (because instantiation may make the comparison forbidden, was our stated logic in the relevant issue). However, this
is the same but with one small difference - an explicit constraint. This currently issues no errors on any comparison, despite ostensibly being identical. This is, perhaps obviously, terribly inconsistent.
The request in the OP of this thread, that
functionfoo<T>(){letx={};xasT;}
be allowed, implies that all of the comparisons I listed above should be allowed. It's certainly doable (and in fact done, implementation on-hand over in #48861). Conversely, if in presenting this inconsistency I've changed your mind and now you think all these comparisons should be forbidden, we need to add a lot of errors to constrained type parameters in comparability (which is going to be much more breaking)!
Fine in 4.7 and 4.6
Fine in 4.6, fails in 4.7
The text was updated successfully, but these errors were encountered: