Skip to content

Readonly<T> miss all internal symbol keys #37182

Closed
@LongTengDao

Description

@LongTengDao

TypeScript Version: 3.8.3

Search Terms: readonly internal symbol

Code

const sym = Symbol();
const x :{
	readonly str :any
	readonly [sym] :any
	readonly [Symbol.iterator] :any
	readonly [Symbol.toStringTag] :any
} = {} as Readonly<{
	str :any
	[sym] :any
	[Symbol.iterator] :any
	[Symbol.toStringTag] :any
}>;

Expected behavior:

no error

Actual behavior:

TS2739 (missing properties Symbol.iterator and Symbol.toStringTag)

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Experimentation NeededSomeone needs to try this out to see what happens

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions