Open Densyakun opened 2 days ago
This is working as intended / a design limitation due to the ambigious syntax for jsx elements and generics. You either need to disable jsx in your config, or use the workaround syntax <T,>
instead of <T>
for your generic.
🔎 Search Terms
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.8.0-dev.20241110#code/MYewdgzgLgBA5gUygKQMoHkByMC8MA8AKgHwAUoYAZgJZwBcMA3gFAwwCuATgDYPSfUwcADSsYACwQBDACYJOEAPwNGMANoBrBAE8+UAUIC6eg3BgBfUeYCUDAAqcQAW2oQERYrk8s2FaDEokYHEAYXAaMzxSHzYYJyRxEBkGAHIAcQBRQhTRWJgUgEFgYAQABygU1KlS0u5qYCkoanAAegArCHAcsTYUsLAoBAGAWkJtUoRK-Ora+sbmsHbOsG68gDoN8nDaNclZeQgYAB8jphsxGwBuMU4kLjAAoPEtqh2ubmFHqGD+iOsemBrKCSMAeUi3CClcBuLwwCFQyAINYdcCkazWa7mS5AA
💻 Code
ArrayFunction is compatible with Generics, is there a bug in TypeScript Compiler or is the usage introduced in TypeScript Deep Dive incorrect?
The following compilers compiled to ArrayFunction:
Use the following code from the TypeScript Deep Dive:
🙁 Actual behavior
Result transpiled to JavaScript:
🙂 Expected behavior
Additional information about the issue
No response