diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index d454aba000565..10db4d54573e4 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -19694,7 +19694,7 @@ namespace ts {
// create a new chain for the constraint error
resetErrorInfo(saveErrorInfo);
}
- if (result = isRelatedTo(source, constraint, RecursionFlags.Target, reportErrors)) {
+ if (result = isRelatedTo(source, constraint, RecursionFlags.Target, reportErrors, /* headMessage */ undefined, intersectionState)) {
return result;
}
// prefer the shorter chain of the constraint comparison chain, and the direct comparison chain
diff --git a/tests/baselines/reference/jsxIntrinsicElementsCompatability.js b/tests/baselines/reference/jsxIntrinsicElementsCompatability.js
new file mode 100644
index 0000000000000..4381071491dba
--- /dev/null
+++ b/tests/baselines/reference/jsxIntrinsicElementsCompatability.js
@@ -0,0 +1,24 @@
+//// [jsxIntrinsicElementsCompatability.tsx]
+///
+import * as React from "react";
+function SomeComponent(props: { element?: T } & JSX.IntrinsicElements[T]): JSX.Element {
+ // Just so the return value is RectElement, the rendered element doesnt matter
+ return
+}
+
+function Test(el: T) {
+ return
+}
+
+//// [jsxIntrinsicElementsCompatability.js]
+"use strict";
+exports.__esModule = true;
+///
+var React = require("react");
+function SomeComponent(props) {
+ // Just so the return value is RectElement, the rendered element doesnt matter
+ return React.createElement("div", null);
+}
+function Test(el) {
+ return React.createElement(SomeComponent, { element: el });
+}
diff --git a/tests/baselines/reference/jsxIntrinsicElementsCompatability.symbols b/tests/baselines/reference/jsxIntrinsicElementsCompatability.symbols
new file mode 100644
index 0000000000000..86da5d624acd1
--- /dev/null
+++ b/tests/baselines/reference/jsxIntrinsicElementsCompatability.symbols
@@ -0,0 +1,33 @@
+=== tests/cases/compiler/jsxIntrinsicElementsCompatability.tsx ===
+///
+import * as React from "react";
+>React : Symbol(React, Decl(jsxIntrinsicElementsCompatability.tsx, 1, 6))
+
+function SomeComponent(props: { element?: T } & JSX.IntrinsicElements[T]): JSX.Element {
+>SomeComponent : Symbol(SomeComponent, Decl(jsxIntrinsicElementsCompatability.tsx, 1, 31))
+>T : Symbol(T, Decl(jsxIntrinsicElementsCompatability.tsx, 2, 23))
+>props : Symbol(props, Decl(jsxIntrinsicElementsCompatability.tsx, 2, 49))
+>element : Symbol(element, Decl(jsxIntrinsicElementsCompatability.tsx, 2, 57))
+>T : Symbol(T, Decl(jsxIntrinsicElementsCompatability.tsx, 2, 23))
+>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12))
+>IntrinsicElements : Symbol(JSX.IntrinsicElements, Decl(react16.d.ts, 2514, 86))
+>T : Symbol(T, Decl(jsxIntrinsicElementsCompatability.tsx, 2, 23))
+>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12))
+>Element : Symbol(JSX.Element, Decl(react16.d.ts, 2494, 23))
+
+ // Just so the return value is RectElement, the rendered element doesnt matter
+ return
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
+}
+
+function Test(el: T) {
+>Test : Symbol(Test, Decl(jsxIntrinsicElementsCompatability.tsx, 5, 1))
+>T : Symbol(T, Decl(jsxIntrinsicElementsCompatability.tsx, 7, 14))
+>el : Symbol(el, Decl(jsxIntrinsicElementsCompatability.tsx, 7, 40))
+>T : Symbol(T, Decl(jsxIntrinsicElementsCompatability.tsx, 7, 14))
+
+ return
+>SomeComponent : Symbol(SomeComponent, Decl(jsxIntrinsicElementsCompatability.tsx, 1, 31))
+>element : Symbol(element, Decl(jsxIntrinsicElementsCompatability.tsx, 8, 25))
+>el : Symbol(el, Decl(jsxIntrinsicElementsCompatability.tsx, 7, 40))
+}
diff --git a/tests/baselines/reference/jsxIntrinsicElementsCompatability.types b/tests/baselines/reference/jsxIntrinsicElementsCompatability.types
new file mode 100644
index 0000000000000..e0479dae19e78
--- /dev/null
+++ b/tests/baselines/reference/jsxIntrinsicElementsCompatability.types
@@ -0,0 +1,28 @@
+=== tests/cases/compiler/jsxIntrinsicElementsCompatability.tsx ===
+///
+import * as React from "react";
+>React : typeof React
+
+function SomeComponent(props: { element?: T } & JSX.IntrinsicElements[T]): JSX.Element {
+>SomeComponent : (props: { element?: T;} & JSX.IntrinsicElements[T]) => JSX.Element
+>props : { element?: T | undefined; } & JSX.IntrinsicElements[T]
+>element : T | undefined
+>JSX : any
+>JSX : any
+
+ // Just so the return value is RectElement, the rendered element doesnt matter
+ return
+> : JSX.Element
+>div : any
+}
+
+function Test(el: T) {
+>Test : (el: T) => JSX.Element
+>el : T
+
+ return
+> : JSX.Element
+>SomeComponent : (props: { element?: T | undefined; } & JSX.IntrinsicElements[T]) => JSX.Element
+>element : T
+>el : T
+}
diff --git a/tests/cases/compiler/jsxIntrinsicElementsCompatability.tsx b/tests/cases/compiler/jsxIntrinsicElementsCompatability.tsx
new file mode 100644
index 0000000000000..faaec4fe77808
--- /dev/null
+++ b/tests/cases/compiler/jsxIntrinsicElementsCompatability.tsx
@@ -0,0 +1,12 @@
+// @strict: true
+// @jsx: react
+///
+import * as React from "react";
+function SomeComponent(props: { element?: T } & JSX.IntrinsicElements[T]): JSX.Element {
+ // Just so the return value is RectElement, the rendered element doesnt matter
+ return
+}
+
+function Test(el: T) {
+ return
+}
\ No newline at end of file