escalier-lang / escalier-next

Improved type safety with tight TypeScript interop
https://escalier-lang.github.io/escalier-next/
MIT License
14 stars 0 forks source link

Fix function overloads #259

Open kevinbarabash opened 5 months ago

kevinbarabash commented 5 months ago

Given the following interface:

interface ArrayConstructor {
    new (arrayLength?: number): any[];
    new <T>(arrayLength: number): T[];
    new <T>(...items: T[]): T[];
    (arrayLength?: number): any[];
    <T>(arrayLength: number): T[];
    <T>(...items: T[]): T[];
    isArray(arg: any): arg is any[];
    readonly prototype: any[];
}

the following Escalier code

        let mut a = new Array<number>();
        a.push(5);

results in a having type _[].