mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Support properties of mapped types in assertion control flow analysis (#40482)
* Support properties of mapped types in assertion control flow analysis * Add regression test * Accept new baselines
This commit is contained in:
@@ -21103,6 +21103,12 @@ namespace ts {
|
||||
return getTypeOfSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & (SymbolFlags.Variable | SymbolFlags.Property)) {
|
||||
if (getCheckFlags(symbol) & CheckFlags.Mapped) {
|
||||
const origin = (<MappedSymbol>symbol).syntheticOrigin;
|
||||
if (origin && getExplicitTypeOfSymbol(origin)) {
|
||||
return getTypeOfSymbol(symbol);
|
||||
}
|
||||
}
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration) {
|
||||
if (isDeclarationWithExplicitTypeAnnotation(declaration)) {
|
||||
|
||||
Reference in New Issue
Block a user