Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested typings unions breaks #3

Open
carmon opened this issue Apr 8, 2020 · 0 comments
Open

Nested typings unions breaks #3

carmon opened this issue Apr 8, 2020 · 0 comments

Comments

@carmon
Copy link

carmon commented Apr 8, 2020

Stack trace:

TS2345: Argument of type '(({ 'error?': string; type: string; } | { image: string; type: string; })[][] | { status: string; type: string; })[][]' is not assignable to parameter of type 'Type'.
  Type '(({ 'error?': string; type: string; } | { image: string; type: string; })[][] | { status: string; type: string; })[][]' is not assignable to type 'ArrayType'.
    Type '(({ 'error?': string; type: string; } | { image: string; type: string; })[][] | { status: string; type: string; })[]' is not assignable to type 'ScalarType'.
      Type '(({ 'error?': string; type: string; } | { image: string; type: string; })[][] | { status: string; type: string; })[]' is not assignable to type 'ObjectType'.
        Index signature is missing in type '(({ 'error?': string; type: string; } | { image: string; type: string; })[][] | { status: string; type: string; })[]'.

Check error in this repo: https://github.com/carmon/boiler-ts

Note the exported:

export type OneTwoThreeWorkingEvent = Event1 | Event2 | Event3;
export type OneTwoThreeNotWorkingEvent = OneTwoEvent | Event3;

First type works, second breaks schema.ts typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant