Skip to content

'Property does not exist on type 'never'." after updating to TS 2.0 #12083

Closed
@aeschli

Description

@aeschli

After updating https://github.com/Microsoft/vscode-css-languageservice to TS 2.0, I get a lot of errors about accesses to a type never.
They always occur in happen after instanceof checks

export class Node {}
export class Nodelist extends Node {}

function finish<T extends Node>(node: T, error: any): T {
    if (!(node instanceof Nodelist)) {
        node.length = 0; // Property 'length' does not exist on type 'never'."
    }
    return node;
}

More workaround for the same error:
cssParser.ts#L135
cssCompletion.ts#L50
cssHover.ts#L41
selectorPrinting.ts#L311
selectorPrinting.ts#L311

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions