Skip to content

Commit fe2e2c6

Browse files
committed
fix confused comment
1 parent d53b16b commit fe2e2c6

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

tests/baselines/reference/jsxExcessPropsAndAssignability.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ tests/cases/compiler/jsxExcessPropsAndAssignability.tsx(16,27): error TS2698: Sp
1717

1818
const props: ComposedComponentProps = null as any;
1919

20-
// Expected no error, got none - good
20+
// Expected no error caused by "myProp", got none - good
2121
<WrapperComponent {...props} myProp={'1000000'} />;
2222
~~~~~
2323
!!! error TS2698: Spread types may only be created from object types.
24-
// Expected error, but got none - bad!
24+
// Expected error caused by "myProp", but got none - bad!
2525
<WrapperComponent {...props} myProp={1000000} />;
2626
~~~~~~~~~~~~~~~~
2727
!!! error TS2322: Type 'ComposedComponentProps & { myProp: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<WrapperComponentProps, any, any>> & Readonly<{ children?: ReactNode; }> & Readonly<WrapperComponentProps>'.

tests/baselines/reference/jsxExcessPropsAndAssignability.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const myHoc = <ComposedComponentProps extends any>(
1111

1212
const props: ComposedComponentProps = null as any;
1313

14-
// Expected no error, got none - good
14+
// Expected no error caused by "myProp", got none - good
1515
<WrapperComponent {...props} myProp={'1000000'} />;
16-
// Expected error, but got none - bad!
16+
// Expected error caused by "myProp", but got none - bad!
1717
<WrapperComponent {...props} myProp={1000000} />;
1818
};
1919

@@ -37,8 +37,8 @@ var React = require("react");
3737
var myHoc = function (ComposedComponent) {
3838
var WrapperComponent = null;
3939
var props = null;
40-
// Expected no error, got none - good
40+
// Expected no error caused by "myProp", got none - good
4141
React.createElement(WrapperComponent, __assign({}, props, { myProp: '1000000' }));
42-
// Expected error, but got none - bad!
42+
// Expected error caused by "myProp", but got none - bad!
4343
React.createElement(WrapperComponent, __assign({}, props, { myProp: 1000000 }));
4444
};

tests/baselines/reference/jsxExcessPropsAndAssignability.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ const myHoc = <ComposedComponentProps extends any>(
3030
>props : Symbol(props, Decl(jsxExcessPropsAndAssignability.tsx, 10, 9))
3131
>ComposedComponentProps : Symbol(ComposedComponentProps, Decl(jsxExcessPropsAndAssignability.tsx, 4, 15))
3232

33-
// Expected no error, got none - good
33+
// Expected no error caused by "myProp", got none - good
3434
<WrapperComponent {...props} myProp={'1000000'} />;
3535
>WrapperComponent : Symbol(WrapperComponent, Decl(jsxExcessPropsAndAssignability.tsx, 8, 9))
3636
>props : Symbol(props, Decl(jsxExcessPropsAndAssignability.tsx, 10, 9))
3737
>myProp : Symbol(myProp, Decl(jsxExcessPropsAndAssignability.tsx, 13, 32))
3838

39-
// Expected error, but got none - bad!
39+
// Expected error caused by "myProp", but got none - bad!
4040
<WrapperComponent {...props} myProp={1000000} />;
4141
>WrapperComponent : Symbol(WrapperComponent, Decl(jsxExcessPropsAndAssignability.tsx, 8, 9))
4242
>props : Symbol(props, Decl(jsxExcessPropsAndAssignability.tsx, 10, 9))

tests/baselines/reference/jsxExcessPropsAndAssignability.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as React from 'react';
66

77
const myHoc = <ComposedComponentProps extends any>(
88
>myHoc : <ComposedComponentProps extends unknown>(ComposedComponent: React.ComponentClass<ComposedComponentProps, any>) => void
9-
><ComposedComponentProps extends any>( ComposedComponent: React.ComponentClass<ComposedComponentProps>,) => { type WrapperComponentProps = ComposedComponentProps & { myProp: string }; const WrapperComponent: React.ComponentClass<WrapperComponentProps> = null as any; const props: ComposedComponentProps = null as any; // Expected no error, got none - good <WrapperComponent {...props} myProp={'1000000'} />; // Expected error, but got none - bad! <WrapperComponent {...props} myProp={1000000} />;} : <ComposedComponentProps extends unknown>(ComposedComponent: React.ComponentClass<ComposedComponentProps, any>) => void
9+
><ComposedComponentProps extends any>( ComposedComponent: React.ComponentClass<ComposedComponentProps>,) => { type WrapperComponentProps = ComposedComponentProps & { myProp: string }; const WrapperComponent: React.ComponentClass<WrapperComponentProps> = null as any; const props: ComposedComponentProps = null as any; // Expected no error caused by "myProp", got none - good <WrapperComponent {...props} myProp={'1000000'} />; // Expected error caused by "myProp", but got none - bad! <WrapperComponent {...props} myProp={1000000} />;} : <ComposedComponentProps extends unknown>(ComposedComponent: React.ComponentClass<ComposedComponentProps, any>) => void
1010

1111
ComposedComponent: React.ComponentClass<ComposedComponentProps>,
1212
>ComposedComponent : React.ComponentClass<ComposedComponentProps, any>
@@ -28,15 +28,15 @@ const myHoc = <ComposedComponentProps extends any>(
2828
>null as any : any
2929
>null : null
3030

31-
// Expected no error, got none - good
31+
// Expected no error caused by "myProp", got none - good
3232
<WrapperComponent {...props} myProp={'1000000'} />;
3333
><WrapperComponent {...props} myProp={'1000000'} /> : JSX.Element
3434
>WrapperComponent : React.ComponentClass<ComposedComponentProps & { myProp: string; }, any>
3535
>props : ComposedComponentProps
3636
>myProp : "1000000"
3737
>'1000000' : "1000000"
3838

39-
// Expected error, but got none - bad!
39+
// Expected error caused by "myProp", but got none - bad!
4040
<WrapperComponent {...props} myProp={1000000} />;
4141
><WrapperComponent {...props} myProp={1000000} /> : JSX.Element
4242
>WrapperComponent : React.ComponentClass<ComposedComponentProps & { myProp: string; }, any>

tests/cases/compiler/jsxExcessPropsAndAssignability.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const myHoc = <ComposedComponentProps extends any>(
1212

1313
const props: ComposedComponentProps = null as any;
1414

15-
// Expected no error, got none - good
15+
// Expected no error caused by "myProp", got none - good
1616
<WrapperComponent {...props} myProp={'1000000'} />;
17-
// Expected error, but got none - bad!
17+
// Expected error caused by "myProp", but got none - bad!
1818
<WrapperComponent {...props} myProp={1000000} />;
1919
};

0 commit comments

Comments
 (0)