Microsoft/TypeScript

The parsing problem of the compiler under specific syntax combinations

Open

#61.975 aperta il 30 giu 2025

Vedi su GitHub
 (2 commenti) (0 reazioni) (1 assegnatario)TypeScript (6726 fork)batch import
BugDomain: ParserHelp Wanted

Metriche repository

Star
 (48.455 star)
Metriche merge PR
 (Merge medio 6g 17h) (9 PR mergiate in 30 g)

Descrizione

🔎 Search Terms

The parsing problem of the compiler under specific syntax combinations

🕗 Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.8.3#code/MYGwhgzhAEAKYDsAuAnAlgUwgHgIID5poBvAKCKOAHsEJUBXYJKlACgAcUNg0IMAuaLgCUJchQlIAFrwB0nbrwzQAvNAU8+4ogF9t6rpoFDSe0gDN6CJmhrQI7MChRUA7q2GCARlSogMiGIS1LRI9lReXhgAJt6+-oFqDBgA3KT6XEj0KAhEAERgXsB50NjQrBARUdHQAPzQCBiucIiomDh06AgA5visBXmigo3N8MjoWNidaD19eV6D0MLyhkppZumW1ki2uQ5OLq4AjB6C0z1BFCF04ZExcX4BuUko9KnpEpnZueWVdzX1EYtcbtKZtWb9MCLYZNYFtSbnXr9BaiZYaNamdIWKw2Oz7ZxuABMp2gPkegTIwRoNz+1QeCWe0GSaQyGCyOXyhWKpV+VRidXKQLG8I64KRA2EQwasOFE1FXXFKKWK0UfHWpCAA

💻 Code

class Pantries<A>  {
    constructor(precise: A) {
        this.precise = precise
    }
    precise: A
}

function sparrow(): boolean {
    const sobbed: boolean = true;

    return  "abc" < (sobbed ? new Pantries<string>("a") : new Pantries<string>("b") ).precise;
}



function sparrow1(): string {
    const sobbed: boolean = true;

    return  (sobbed ? new Pantries<string>("a") : new Pantries<string>("b") ).precise;
}


function sparrow2(): boolean {
    const sobbed: boolean = true;

    return  "abc" < (sobbed ? (new Pantries<string>("a")) : new Pantries<string>("b") ).precise;
}

🙁 Actual behavior

There was a problem when parsing the sparrow method, while the other methods worked fine.

🙂 Expected behavior

There will be no error reports or clear prompts

Additional information about the issue

No response

Guida contributor