Fix services' type's isLiteral implementation#50929
Conversation
|
This might be considered annoying behavior for boolean literals. Let's keep an eye on user feedback. |
|
I feel like the API change is really an API bugfix, but can you make a note of it in https://github.com/microsoft/TypeScript/wiki/API-Breaking-Changes once merged? |
Sure. Now that you mention merging, should I wait until after 4.9 rc to merge this, so it gets into 5.0? Or does it not matter since it's an API break in services only? |
|
I just realized that |
|
@typescript-bot perf test this faster |
|
Heya @gabritto, I've started to run the abridged perf test suite on this PR at 297f892. You can monitor the build here. Update: The results are in! |
|
@gabritto Here they are:Comparison Report - main..50929
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Is this a typo? |
Yes, I meant to say BigInt literals. Thanks for catching it! |
|
(Sorry for spamming this PR, I'm making sure our perf infra is working) |
|
@typescript-bot perf test this faster |
|
@typescript-bot perf test this |
|
Heya @gabritto, I've started to run the perf test suite on this PR at 297f892. You can monitor the build here. Update: The results are in! |
|
@typescript-bot perf test this faster |
|
Heya @gabritto, I've started to run the abridged perf test suite on this PR at 297f892. You can monitor the build here. Update: The results are in! |
|
@gabritto Here they are:
CompilerComparison Report - main..50929
System
Hosts
Scenarios
TSServerComparison Report - main..50929
System
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@gabritto Here they are:Comparison Report - main..50929
System
Hosts
Scenarios
Developer Information: |
Not sure if there's a bug for this, but the implementation of the method
isLiteral()inTypeinterface inservicesis wrong, and only returned true for number or string literal types. Now it will also return true for boolean literal types and bigint literal types.This affects our literal completions: before this change, we only completed literals for number and string literal types, never for bigints or booleans.
Note that completions for
trueandfalseare sorted as keywords (because they are keywords).Note also that this is a breaking API change, but also a bug fix... 🤨