Skip to content

Assertion error with if-else-if inside class #5444

Closed
@jeffreymorlan

Description

@jeffreymorlan

Type-checking the following (broken) program:

class C {
    if (a) {}
    else if (0) {}
}

results in an assertion error:

Error: Debug Failure. False expression: 
    at Object.assert (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:724:23)
    at reportImplementationExpectedError (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:18530:38)
    at checkFunctionOrConstructorSymbol (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:18580:25)
    at checkFunctionLikeDeclaration (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:18943:21)
    at checkMethodDeclaration (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:18251:13)
    at checkSourceElement (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:20413:28)
    at Object.forEach (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:90:30)
    at checkClassDeclaration (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:19663:16)
    at checkSourceElement (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:20477:28)
    at Object.forEach (/home/jeffrey/TypeScript-1.6.2/lib/tsc.js:90:30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions