-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix string/number literals in interface method generic parameter defa…
…ult/extends Fixes #1035
- Loading branch information
1 parent
4724f0e
commit d84f2b1
Showing
7 changed files
with
461 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
original file | ||
----------------------------------- | ||
let var1; | ||
|
||
interface MyInterface { | ||
func1<T = Lowercase<'StringLiteral'>>(): T; | ||
func2<T = Lowercase<"StringLiteral">>(): T; | ||
func3<T = Lowercase<123>>(): T; | ||
} | ||
|
||
let var2; | ||
|
||
----------------------------------- | ||
|
||
Grammar: TypeScript.tmLanguage | ||
----------------------------------- | ||
>let var1; | ||
^^^ | ||
source.ts meta.var.expr.ts storage.type.ts | ||
^ | ||
source.ts meta.var.expr.ts | ||
^^^^ | ||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts | ||
^ | ||
source.ts punctuation.terminator.statement.ts | ||
> | ||
^ | ||
source.ts | ||
>interface MyInterface { | ||
^^^^^^^^^ | ||
source.ts meta.interface.ts storage.type.interface.ts | ||
^ | ||
source.ts meta.interface.ts | ||
^^^^^^^^^^^ | ||
source.ts meta.interface.ts entity.name.type.interface.ts | ||
^ | ||
source.ts meta.interface.ts | ||
^ | ||
source.ts meta.interface.ts punctuation.definition.block.ts | ||
> func1<T = Lowercase<'StringLiteral'>>(): T; | ||
^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts | ||
^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts keyword.operator.assignment.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts | ||
^^^^^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.single.ts punctuation.definition.string.begin.ts | ||
^^^^^^^^^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.single.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.single.ts punctuation.definition.string.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts punctuation.terminator.statement.ts | ||
> func2<T = Lowercase<"StringLiteral">>(): T; | ||
^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts | ||
^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts keyword.operator.assignment.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts | ||
^^^^^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.double.ts punctuation.definition.string.begin.ts | ||
^^^^^^^^^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.double.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts string.quoted.double.ts punctuation.definition.string.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts punctuation.terminator.statement.ts | ||
> func3<T = Lowercase<123>>(): T; | ||
^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts | ||
^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts keyword.operator.assignment.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts | ||
^^^^^^^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts | ||
^^^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts | ||
^ | ||
source.ts meta.interface.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts | ||
^ | ||
source.ts meta.interface.ts punctuation.terminator.statement.ts | ||
>} | ||
^ | ||
source.ts meta.interface.ts punctuation.definition.block.ts | ||
> | ||
^ | ||
source.ts | ||
>let var2; | ||
^^^ | ||
source.ts meta.var.expr.ts storage.type.ts | ||
^ | ||
source.ts meta.var.expr.ts | ||
^^^^ | ||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts | ||
^ | ||
source.ts punctuation.terminator.statement.ts | ||
> | ||
^ | ||
source.ts |
Oops, something went wrong.