* Allow intersections of readonlys to be assignable to a readonly intersection * Add real motivating react example to test suite
9 lines
246 B
TypeScript
9 lines
246 B
TypeScript
// @strict: true
|
|
function f<TType>(
|
|
a: { weak?: string } & Readonly<TType> & { name: "ok" },
|
|
b: Readonly<TType & { name: string }>,
|
|
c: Readonly<TType> & { name: string }) {
|
|
c = a; // Works
|
|
b = a; // Should also work
|
|
}
|