mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Set syntheticLiteralTypeOrigin on synthetic undefined-type members (#22216)
* Have getNameOfSymbolAsWritten quote nonidentifier nonnumeric symbols all the time * Revert checker changes * Reuse synthetic origin to indicate that derived declaration name may need to be quoted
This commit is contained in:
1 parent
1a43ad01a7
commit
b8e0009c9b
5 files changed
+58
No files matched your search
@@ -11150,6 +11150,10 @@ namespace ts {
|
||||
}
|
||||
const result = createSymbol(SymbolFlags.Property | SymbolFlags.Optional, name);
|
||||
result.type = undefinedType;
|
||||
const associatedKeyType = getLiteralType(unescapeLeadingUnderscores(name));
|
||||
if (associatedKeyType.flags & TypeFlags.StringLiteral) {
|
||||
result.syntheticLiteralTypeOrigin = associatedKeyType as StringLiteralType;
|
||||
}
|
||||
undefinedProperties.set(name, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user