types icon indicating copy to clipboard operation
types copied to clipboard

Make some/all input types readonly? (dict members, arrays, tuples)

Open kainino0x opened this issue 5 years ago • 2 comments

This way if an application holds a readonly type it can pass it into WebGPU without having to cast it to writable.

kainino0x avatar Sep 12 '20 00:09 kainino0x

Looking at this again, realizing it should apply to all of the dictionary members too, not just arrays.

kainino0x avatar Feb 29 '24 21:02 kainino0x

In practice this is not very much of a problem because TypeScript is extremely lax about readonly enforcement and allows implicit conversion from readonly to writable in a lot of cases. I'm not even aware of warnings or lint options that make it stricter.

kainino0x avatar Feb 29 '24 21:02 kainino0x