Giter Club home page Giter Club logo

Comments (4)

Andarist avatar Andarist commented on August 27, 2024 1

Could you try to narrow it down? It's almost impossible to fix this without knowing what source files lead to the problem.

from typescript.

Roise-yue avatar Roise-yue commented on August 27, 2024 1

I have filtered out the ts files that can cause the above problem and located the code lines in the files that may cause errors.
I have modified tsconfig.json,and used version 5.4.5 of the tsc testing program on the Ubuntu 22.04.3 LTS platform.

I have provided configuration files, TS source files, and specific error messages in this repository:https://github.com/Roise-yue/tscFuzz

from typescript.

DanielRosenwasser avatar DanielRosenwasser commented on August 27, 2024

Yes, one thing you could try is to keep deleting files until you've found a culprit. Then when you've narrowed things down to as few files as possible, try to delete as many lines of code as you can.

from typescript.

DanielRosenwasser avatar DanielRosenwasser commented on August 27, 2024

Thank you so much for finding these @Roise-yue! I'm copying those files into this comment to make it easier to follow - the transform crash is from the use of the accessor keyword used in certain spots:

// @target: esnext
// @noTypesAndSymbols: true

abstract class C1 {
    accessor accessor a: any;
    readonly accessor b: any;
    declare accessor c: any;
    accessor public d: any;
    accessor private e: any;
    accessor protected f: any;
    accessor abstract g: any;
    accessor static h: any;
    accessor i() {}
    accessor get j() { return false; }
    accessor set k(v: any) {}
    accessor constructor() {}
    accessor l?: any;
    accessor readonly m: any;
    accessor declare n: any;
}

class C2 extends C1 {
    accessor override g: any;
}

interface I1 {
    accessor a: number;
}

accessor class C3 {}
accessor interface I2 {}
accessor namespace N1 {}
accessor enum E1 {}   // Error location
accessor var V1: any;
accessor type T1 = never;
accessor function F1() {}
accessor import "x";
accessor import {} from "x";
accessor export { V1 };
accessor export default V1;
accessor import N2 = N1;

(Playground link here)

And the other error I haven't been able to verify independently, but I'm pasting it here.

// @importHelpers: true
// @target: es5
// @module: commonjs
// @moduleResolution: classic
// @experimentalDecorators: true
// @emitDecoratorMetadata: true
// @filename: external.ts
export * from "./other";
export class A { }
export class B extends A { }

declare var dec: any;

@dec
class C {
    method(@dec x: number) {    // Error location
    }
}

const o = { a: 1 };
const y = { ...o };
const { ...x } = y;

// @filename: other.ts
export const x = 1;

// @filename: script.ts
class A { }
class B extends A { }

declare var dec: any;

@dec
class C {
    method(@dec x: number) {
    }
}

// @filename: tslib.d.ts
export {}

from typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.