`Readonly<T>` not assignable to `T` with optional properties

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Closed

@mhegazy

Description

type T = { a? : number, b: string };
var y: T;
var x: Readonly<T> = y; // Error: Property 'a' is optional

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions