mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix property completion in unions of object types and template literal types (#52196)
This commit is contained in:
@@ -6053,7 +6053,7 @@ export const enum TypeFlags {
|
||||
/** @internal */
|
||||
Intrinsic = Any | Unknown | String | Number | BigInt | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive,
|
||||
/** @internal */
|
||||
Primitive = String | Number | BigInt | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol,
|
||||
Primitive = String | Number | BigInt | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol | TemplateLiteral,
|
||||
StringLike = String | StringLiteral | TemplateLiteral | StringMapping,
|
||||
NumberLike = Number | NumberLiteral | Enum,
|
||||
BigIntLike = BigInt | BigIntLiteral,
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////type UnionType = {
|
||||
//// key1: string;
|
||||
////} | {
|
||||
//// key2: number;
|
||||
////} | `string literal ${string}`;
|
||||
////
|
||||
////const obj1: UnionType = {
|
||||
//// /*1*/
|
||||
////};
|
||||
////
|
||||
////const obj2: UnionType = {
|
||||
//// key1: "abc",
|
||||
//// /*2*/
|
||||
////};
|
||||
|
||||
verify.completions({
|
||||
marker: '1',
|
||||
exact: [{ name: 'key1' }, { name: 'key2' }]
|
||||
})
|
||||
|
||||
verify.completions({
|
||||
marker: '2',
|
||||
exact: [{ name: 'key2' }]
|
||||
})
|
||||
Reference in New Issue
Block a user