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
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.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
bug extends number bigint
π Version & Regression Information
β― Playground Link
Playground link with relevant code
Playground link with original code from #44578
π» Code
π Actual behavior
+key
is not an error ingetKey2
.π Expected behavior
It should be an error to be consistent with
getKey
, asS
could benumberOrBigint
instead of a more specific type.The text was updated successfully, but these errors were encountered: