-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back from globalReadonlyArrayType
to globalArrayType
when transpiling
#30734
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, does this repro with a compiler test too, or does it require a unit test to trigger?
@sandersn I wasn't able to get it to repro with a compiler test, but in hindsight there was probably an option that does trigger it. I think I tried |
Fix at microsoft/TypeScript#30734 for an issue with TypeScript 3.4.x and use of `readonly T[]`, which causes webpack to report the following error: ``` TypeError: Cannot read property 'instantiations' of undefined ```
* upgrade to TypeScript 3.5.0 (dev) to fix `readonly` bug Fix at microsoft/TypeScript#30734 for an issue with TypeScript 3.4.x and use of `readonly T[]`, which causes webpack to report the following error: ``` TypeError: Cannot read property 'instantiations' of undefined ``` * remove use of toString method on generic type parameter (TS 3.5 rejects it) ``` ../shared/src/util/memoizeObservable.ts:37:58 - error TS2339: Property 'toString' does not exist on type 'P'. const key = resolver ? resolver(params) : params.toString() ```
Fall back from `globalReadonlyArrayType` to `globalArrayType` when transpiling
Fall back from `globalReadonlyArrayType` to `globalArrayType` when transpiling
Syntax like
([''] as const).forEach
orlet x: readonly string[]
implicitly referencesReadonlyArray
which isn't included when transpiling, so fall back to referencing the global Array type instead.Fixes #30664