Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Update for microsoft/TypeScript#30568

* Use assignability instead of ExpectType

Since assignability allows subtype relations
  • Loading branch information
sandersn authored and alesn committed Apr 23, 2019
1 parent cd2a449 commit 30f7148
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions types/airbnb-prop-types/airbnb-prop-types-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ AirbnbPropTypes.nonNegativeNumber();
// $ExpectType Requireable<string>
AirbnbPropTypes.numericString();

// $ExpectType Requireable<{}>
AirbnbPropTypes.object();
// $ExpectType Requireable<object>
const props: PropTypes.Requireable<object> = AirbnbPropTypes.object();
// $ExpectType Requireable<{ foo: string; }>
AirbnbPropTypes.object<{ foo: string }>();

Expand Down
2 changes: 1 addition & 1 deletion types/lodash/lodash-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4989,7 +4989,7 @@ fp.now(); // $ExpectType number
_.create(prototype, properties); // $ExpectType { a: number; } & { b: string; }
_(prototype).create(properties); // $ExpectType LoDashImplicitWrapper<{ a: number; } & { b: string; }>
_.chain(prototype).create(properties); // $ExpectType LoDashExplicitWrapper<{ a: number; } & { b: string; }>
fp.create(prototype); // $ExpectType { a: number; }
const combined: { a: number } & object = fp.create(prototype);
}

// _.defaultsDeep
Expand Down
4 changes: 1 addition & 3 deletions types/react/test/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ const Memoized5 = React.memo<{ test: boolean }>(

<Memoized5 test/>;

// for some reason the ExpectType doesn't work if the type is namespaced
// $ExpectType NamedExoticComponent<{}>
const Memoized6 = React.memo(props => null);
const Memoized6: React.NamedExoticComponent<object> = React.memo(props => null);
<Memoized6/>;
// $ExpectError
<Memoized6 foo/>;
Expand Down

0 comments on commit 30f7148

Please sign in to comment.