Skip to content

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

Description

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:

declarefunctionf(x: "str");declarefunctionf(x: String);

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

Metadata

Metadata

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