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