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
{{ message }}
Repository navigation
Upper-bounded generic type relaxes bigint restriction #49907
typenumberOrBigint=number|bigint;functiongetKey(key: numberOrBigint){// @ts-expect-error ✔+key;// @ts-expect-error ✔0+key;}functiongetKey2<SextendsnumberOrBigint>(key: S){// @ts-expect-error ❌ should error, but the compiler does not+key;// @ts-expect-error ✔0+key;}
🙁 Actual behavior
+key is not an error in getKey2.
🙂 Expected behavior
It should be an error to be consistent with getKey, as S could be numberOrBigint instead of a more specific type.
Activity