Skip to content

[spec] Apparent type of string literal type should be global interface String #543

Closed
@mhegazy

Description

@mhegazy

Section 3.8.1 should be augmented to say that a string literal type should have as its apparent type the interface String.

This is to enable things like:

declare function f(x: "str");
declare function f(x: String);

The new compiler is already doing this. We just need to change the spec and add a test for it.

Metadata

Metadata

Assignees

Labels

SpecIssues related to the TypeScript language specification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions