You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unexpected behaviour when use Omit with Insection Types #39359
test.ts:21:3 - error TS2322: Type 'string' is not assignable to type 'never'.
21 name: 'hello',
~~~~
test.ts:22:3 - error TS2322: Type 'number' is not assignable to type 'never'.
22 age: 123,
~~~
test.ts:23:3 - error TS2322: Type 'string' is not assignable to type 'never'.
23 occupation: '123',
~~~~~~~~~~
test.ts:24:3 - error TS2322: Type 'string' is not assignable to type 'never'.
24 role: '123'
~~~~
Activity
dragomirtitian commentedon Jul 1, 2020
This is related to a recent change in behavior from #36696, where intersection resulting in a field of type
neverare reduced tonever.You can change your types to this:
Playground Link
RyanCavanaugh commentedon Jul 7, 2020
Titian Cernicova-Dragomir (@dragomirtitian) has it right 👆
typescript-bot commentedon Jul 10, 2020
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.