@@ -6035,7 +6035,7 @@ namespace ts {
6035
6035
(<TypeOperatorNode>constraintDeclaration).operator === SyntaxKind.KeyOfKeyword) {
6036
6036
// We have a { [P in keyof T]: X }
6037
6037
for (const prop of getPropertiesOfType(modifiersType)) {
6038
- addMemberForKeyType(getLiteralTypeFromPropertyName(prop, include), undefined, prop);
6038
+ addMemberForKeyType(getLiteralTypeFromPropertyName(prop, include), /*_index*/ undefined, prop);
6039
6039
}
6040
6040
if (modifiersType.flags & TypeFlags.Any || getIndexInfoOfType(modifiersType, IndexKind.String)) {
6041
6041
addMemberForKeyType(stringType);
@@ -6062,7 +6062,7 @@ namespace ts {
6062
6062
const propType = instantiateType(templateType, templateMapper);
6063
6063
// If the current iteration type constituent is a string literal type, create a property.
6064
6064
// Otherwise, for type string create a string index signature.
6065
- if (t.flags & TypeFlags.StringLiteral ) {
6065
+ if (t.flags & TypeFlags.StringOrNumberLiteralOrUnique ) {
6066
6066
const propName = getLateBoundNameFromType(t as LiteralType);
6067
6067
const modifiersProp = getPropertyOfType(modifiersType, propName);
6068
6068
const isOptional = !!(templateModifiers & MappedTypeModifiers.IncludeOptional ||
@@ -6511,7 +6511,7 @@ namespace ts {
6511
6511
let declarations: Declaration[];
6512
6512
let commonType: Type;
6513
6513
let nameType: Type;
6514
- let propTypes: Type[] = [];
6514
+ const propTypes: Type[] = [];
6515
6515
let first = true;
6516
6516
for (const prop of props) {
6517
6517
declarations = addRange(declarations, prop.declarations);
@@ -8146,7 +8146,7 @@ namespace ts {
8146
8146
type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? keyofConstraintType :
8147
8147
keyofStringsOnly ? getLiteralTypeFromPropertyNames(type, TypeFlags.StringLiteral) :
8148
8148
getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, TypeFlags.StringLiteral | TypeFlags.UniqueESSymbol)]) :
8149
- getLiteralTypeFromPropertyNames(type, TypeFlags.StringLiteral | TypeFlags.NumberLiteral | TypeFlags.UniqueESSymbol );
8149
+ getLiteralTypeFromPropertyNames(type, TypeFlags.StringOrNumberLiteralOrUnique );
8150
8150
}
8151
8151
8152
8152
function getExtractStringType(type: Type) {
0 commit comments