mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-27 04:46:25 -05:00
Make getContextualTypeOfApparentType mapType over unions (#17668)
* Instantiate contextual types while in an inferrential context * Limit scope of instantiation to only when likely needed * Still get aparent type * Expand test * Fix nit * Handle JSX and array * Tests for the JSX and Array cases * After much deliberation and inspection, much simpler fix After much deliberation and inspection, much simpler fix Undo Redo
This commit is contained in:
@@ -13691,7 +13691,7 @@ namespace ts {
|
||||
// be "pushed" onto a node using the contextualType property.
|
||||
function getApparentTypeOfContextualType(node: Expression): Type {
|
||||
const type = getContextualType(node);
|
||||
return type && getApparentType(type);
|
||||
return type && mapType(type, getApparentType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user