@@ -13548,13 +13548,16 @@ namespace ts {
13548
13548
return _jsxElementChildrenPropertyName;
13549
13549
}
13550
13550
13551
- function createIntersectionOfApparentTypeOfJsxPropsType(propsType: Type): Type {
13552
- if (propsType && propsType.flags & TypeFlags.Intersection) {
13553
- const propsApprentType: Type[] = [];
13554
- for (const t of (<UnionOrIntersectionType>propsType).types) {
13555
- propsApprentType.push(getApparentType(t));
13551
+ function getApparentTypeOfJsxPropsType(propsType: Type): Type {
13552
+ if (propsType) {
13553
+ if (propsType.flags & TypeFlags.Intersection) {
13554
+ const propsApprentType: Type[] = [];
13555
+ for (const t of (<UnionOrIntersectionType>propsType).types) {
13556
+ propsApprentType.push(getApparentType(t));
13557
+ }
13558
+ return getIntersectionType(propsApprentType);
13556
13559
}
13557
- return getIntersectionType(propsApprentType );
13560
+ return getApparentType(propsType );
13558
13561
}
13559
13562
return propsType;
13560
13563
}
@@ -13579,7 +13582,7 @@ namespace ts {
13579
13582
if (callSignature !== unknownSignature) {
13580
13583
const callReturnType = callSignature && getReturnTypeOfSignature(callSignature);
13581
13584
let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));
13582
- paramType = createIntersectionOfApparentTypeOfJsxPropsType (paramType);
13585
+ paramType = getApparentTypeOfJsxPropsType (paramType);
13583
13586
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
13584
13587
// Intersect in JSX.IntrinsicAttributes if it exists
13585
13588
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);
@@ -13618,7 +13621,7 @@ namespace ts {
13618
13621
for (const candidate of candidatesOutArray) {
13619
13622
const callReturnType = getReturnTypeOfSignature(candidate);
13620
13623
let paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0]));
13621
- paramType = createIntersectionOfApparentTypeOfJsxPropsType (paramType);
13624
+ paramType = getApparentTypeOfJsxPropsType (paramType);
13622
13625
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
13623
13626
let shouldBeCandidate = true;
13624
13627
for (const attribute of openingLikeElement.attributes.properties) {
0 commit comments