ae652404cd
Previously, the code didn't account for the fact that spreading a union creates a union. In fact, before Decemeber, spreading a union in JSX didn't create a union. Now the check for properties of the spread type uses `getPropertiesOfType`, which works with unions, instead of accessing the `properties` property directly.
25 lines
503 B
TypeScript
25 lines
503 B
TypeScript
// @strictNullChecks: true
|
|
// @filename: file.tsx
|
|
// @jsx: preserve
|
|
// @noLib: true
|
|
// @skipLibCheck: true
|
|
// @libFiles: lib.d.ts
|
|
|
|
declare global {
|
|
namespace JSX {
|
|
interface Element {}
|
|
interface ElementAttributesProperty { props: {} }
|
|
}
|
|
}
|
|
declare var React: any;
|
|
|
|
export class Empty extends React.Component<{}, {}> {
|
|
render() {
|
|
return <div>Hello</div>;
|
|
}
|
|
}
|
|
|
|
declare const obj: { a: number | undefined } | undefined;
|
|
|
|
// OK
|
|
let unionedSpread = <Empty {...obj} />;
|