Skip to content

Language service 1.4 in Visual Studio is not back compatible with the 1.1 compiler #1741

Closed
@DavidRigglemanININ

Description

@DavidRigglemanININ

The following code compiles fine with 1.1 compiler (and even the 1.3 language service), but produces an error when using the 1.4 language service when the TypeScriptToolsVersion element is set to 1.1. The code below has to do with function overloading of sorts, and I can see why the type checking fails, but I thought it was a stated goal that upgrading to a new language service but keeping an old compiler should not break anything (as long as, of course, new features aren't used)

module Test {

    export function baseMethodOverload(a: string, b: number, ...arr: Int32Array[]): string {
        // Argument of type 'Int32Array[]' is not assignable to the parameter of type 'string | number'
        return baseMethod.apply(this, [a, b, "c"].concat(arr));
    }

    export function baseMethod(a: string, b: number, c: string, ...arr: Int32Array[]): string {
        return a + b + c;
    }
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions