@@ -13467,13 +13467,16 @@ namespace ts {
13467
13467
return _jsxElementChildrenPropertyName;
13468
13468
}
13469
13469
13470
- function createIntersectionOfApparentTypeOfJsxPropsType(propsType: Type): Type {
13471
- if (propsType && propsType.flags & TypeFlags.Intersection) {
13472
- const propsApprentType: Type[] = [];
13473
- for (const t of (<UnionOrIntersectionType>propsType).types) {
13474
- propsApprentType.push(getApparentType(t));
13470
+ function getApparentTypeOfJsxPropsType(propsType: Type): Type {
13471
+ if (propsType) {
13472
+ if (propsType.flags & TypeFlags.Intersection) {
13473
+ const propsApprentType: Type[] = [];
13474
+ for (const t of (<UnionOrIntersectionType>propsType).types) {
13475
+ propsApprentType.push(getApparentType(t));
13476
+ }
13477
+ return getIntersectionType(propsApprentType);
13475
13478
}
13476
- return getIntersectionType(propsApprentType );
13479
+ return getApparentType(propsType );
13477
13480
}
13478
13481
return propsType;
13479
13482
}
@@ -13498,7 +13501,7 @@ namespace ts {
13498
13501
if (callSignature !== unknownSignature) {
13499
13502
const callReturnType = callSignature && getReturnTypeOfSignature(callSignature);
13500
13503
let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));
13501
- paramType = createIntersectionOfApparentTypeOfJsxPropsType (paramType);
13504
+ paramType = getApparentTypeOfJsxPropsType (paramType);
13502
13505
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
13503
13506
// Intersect in JSX.IntrinsicAttributes if it exists
13504
13507
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);
@@ -13537,7 +13540,7 @@ namespace ts {
13537
13540
for (const candidate of candidatesOutArray) {
13538
13541
const callReturnType = getReturnTypeOfSignature(candidate);
13539
13542
let paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0]));
13540
- paramType = createIntersectionOfApparentTypeOfJsxPropsType (paramType);
13543
+ paramType = getApparentTypeOfJsxPropsType (paramType);
13541
13544
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
13542
13545
let shouldBeCandidate = true;
13543
13546
for (const attribute of openingLikeElement.attributes.properties) {
0 commit comments