-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitter
Milestone
Description
TypeScript Version: 3.2.0-dev.20181106
Code
import React = require("react");
function f<P>(App: React.ComponentClass<P> | React.StatelessComponent<P>): void {
class C extends React.Component<P & { x: number }> {
render() {
return <App {...this.props} />;
}
}
}Expected behavior:
No error, as in ts3.1.
Actual behavior:
src/a.tsx:6:21 - error TS2322: Type 'Readonly<{ children?: ReactNode; }> & Readonly<P & { x: number; }>' is not assignable to type 'IntrinsicAttributes & P & { children?: ReactNode; }'.
Type 'Readonly<{ children?: ReactNode; }> & Readonly<P & { x: number; }>' is not assignable to type 'P'.
6 return <App {...this.props} />;
~~~
Found 1 error.
Found in next on DefinitelyTyped.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitter