Open
Description
π Search Terms
ReadonlySet
, ReadonlyMap
, Symbol.toStringTag
π Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about ReadonlySet
, ReadonlyMap
, Symbol.toStringTag
β― Playground Link
π» Code
type MutatingMapMethodName = Exclude<keyof Map<unknown, unknown>, keyof ReadonlyMap<unknown, unknown>>
type MutatingSetMethodName = Exclude<keyof Set<unknown>, keyof ReadonlySet<unknown>>
// @ts-expect-error
let a: MutatingMapMethodName = Symbol.toStringTag
// @ts-expect-error
let b: MutatingSetMethodName = Symbol.toStringTag
π Actual behavior
Both @ts-expect-error
s give Unused '@ts-expect-error' directive.(2578)
π Expected behavior
Both @ts-expect-error
s are used
Additional information about the issue
No response