Skip to content

Characters count as both prefix and suffix of pattern literal #40772

Description

TypeScript Version: v4.1.0-dev20200925

Search Terms: pattern literal prefix suffix

Code

consts: `:${string}:` =":";

Expected behavior:
Assignability error because the pattern `:${string}:` has two literal : characters, while ":" has only one.

Actual behavior:
No error

Playground Link

Related Issues:#40598

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions