-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Crash when defining Array
type via []
syntax
#57009
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Just to be clear, this isn't going to work |
lol, I know. I reduced the repro example from something like I expect this code to give an error about a circular type reference as if I had written |
It seems there's an internal failure that happens before this crash. It's not my particular definition of the // @noLib: true
// okay with this definition of Array:
// interface Array<T> {
// [i:number]:T
// }
// okay with this definition of Array, too:
// class Array<T> {
// [i:number]:T
// }
// With this definition, things fail and number[] is not the same type as Array<T> anymore:
type Array<T> = {
[i:number]:T
}
[1,2,3] satisfies {[i:number]:any}
declare const x:number[]
// ^?
x satisfies Array<number> |
π Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of this repro running against the nightly TypeScript. β Failed: -
Historical Information
|
moved this to standalone issue #57564 |
π Search Terms
Array type define crash
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?noLib=true#code/PTAEAEDsHsBkEsBGAuUAXATgVwKYCg0BPABx1AEEMMBDQgHgBUA+UAXlAYG0BdAbjyA
π» Code
π Actual behavior
Typescript crashes:
π Expected behavior
I expect an error message.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: