Skip to content

Not possible to compile latest Angular 2 due to literal types #11794

Closed
@alfaproject

Description

@alfaproject

TypeScript Version: nightly (2.1.0-dev.20161022)

Code
https://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/expression_parser/lexer.ts#L296

Expected behavior:
No compiler errors.

Actual behavior:

› ./node_modules/.bin/tsc --version
Version 2.1.0-dev.20161022

› ./node_modules/.bin/tsc -p ./modules/tsconfig.json
modules/@angular/compiler/src/expression_parser/lexer.ts(296,13): error TS2365: Operator '==' cannot be applied to types '92' and '117'.

It looks like literal type inference went a bit aggressive with this particular piece of code.
Funnily enough, I've tried to isolate the issue in a more concise class with just a scan method but works all the time, so it must be some weird combination of things going on here, which I couldn't figure out. ):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions