You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect Readonly<[number, string, boolean] & { att: string }> to be readonly [number, string, boolean] & { readonly att: string }, but that's wishful thinking. I'm sure you guys got a myriad of reasons and design limitations that don't allow it; weak types, homomorphic, variance, instantiation and whatnot.
In any case, I thought, whatever, I'll do it myself with some infers... but it looks like I won't be able to do the general case because infers break on tuple types that are intersected.
So, just letting you know in case you care... here are some unexpected behaviors βοΈ
The text was updated successfully, but these errors were encountered:
π Search Terms
infer tuple intersection
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAKghgJwOYWFAvFA2gOwK4C2ARhAgDRQDOwCAljkhUQPbMA2EcOAulAGRQA3lDjBgALio16SANxQAvrICwAKDWhIUAIIYoAJU4ATZjjYgAPPGSoAfPID0DqAHdalABYAzPGyjAPegBrGTUNcGgACWMARj1rFDQIAA9gCBwjSmx6L1IoSIoAOmKcvPhaNl4AfnyoSRwIADdSR2cTCEocAHI0F2YEIPCtaLgjACZ4xESoFLSMrKxShHyi4q4QLG5q2vqmlqgnV36gyjDVTWhytjjMBNQZ1PTM7Jxc5YKoYsKl2DgK7audSgDWaCFaUHanR6RwGQ0ufzYE1uU3usyeC3Wq2 rzKCIBCKBIP2h0h3V6xzOFwMewQlAgIyMN1 NiSj3m2C P30VwoXMi230kUJNPBpOhfVh5wi1NBdIZSOZ0zR7KwX3Wm15OOWgoFQt2oNFzA6ZJhg3UUq0hllECuTLurLmz1VJS1Bh5UD5AsB uJbSNUPJkqpVtIdKuCvtD0dC05ru5CIo6y9BJ9YIOfuN4opqiAA
π» Code
π Actual behavior
Doesn't work
π Expected behavior
Works
Additional information about the issue
I would expect
Readonly<[number, string, boolean] & { att: string }>
to bereadonly [number, string, boolean] & { readonly att: string }
, but that's wishful thinking. I'm sure you guys got a myriad of reasons and design limitations that don't allow it; weak types, homomorphic, variance, instantiation and whatnot.In any case, I thought, whatever, I'll do it myself with some infers... but it looks like I won't be able to do the general case because infers break on tuple types that are intersected.
So, just letting you know in case you care... here are some unexpected behaviors βοΈ
The text was updated successfully, but these errors were encountered: