Skip to content

Old-style octal literal types are treated as decimal literal types #10101

@sandersn

Description

@sandersn
// @target: es3
const i: 010 = 8;

Actual:

const i: 010 = 8;
      ~
      Error: Type '8' is not assignable to type '10';

Expected:

const i: 010 = 8;
         ~~~
         Error: Octal literal types must use ES2015 syntax. Use the syntax '0o10'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions