Skip to content

Can we correctly understand TypeScript with only a lexer? #4316

@jafl

Description

@jafl

This example seems like it requires a parser, not just a lexer:

function identity<Type>(arg: Type): Type {
  return arg;
}

let output = identity<string>("myString");

Without knowing what comes after < in the last line, it seems to be impossible to tell if it's a comparison operator or a generics declaration.

Metadata

Metadata

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