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

union types within interfaces seem to be interpreted as section #6186

Closed
danrot opened this issue Apr 23, 2018 · 1 comment
Closed

union types within interfaces seem to be interpreted as section #6186

danrot opened this issue Apr 23, 2018 · 1 comment

Comments

@danrot
Copy link

danrot commented Apr 23, 2018

We are using mobx, and we are getting the following error since recently:

Cannot call `configure` with object literal bound to `options` because string [1] is incompatible with boolean [2] in
property `enforceActions`.

   src/Sulu/Bundle/AdminBundle/Resources/js/index.js:45:11
   45| configure({enforceActions: 'strict'});
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
   src/Sulu/Bundle/AdminBundle/Resources/js/index.js:45:28
   45| configure({enforceActions: 'strict'});
                                  ^^^^^^^^ [1]
   node_modules/mobx/lib/mobx.js.flow:6:22
    6|     enforceActions?: boolean | "strict",
                            ^^^^^^^ [2]

You can also see our CI build for the full output.

IMO everything is correct here, but flow doesn't read that correctly. Have also made a small reproducible example here: https://flow.org/try/#0PTAEAEDMBsHsHcBQBLAdgFwKYCdIEMBjTUAeQAd1lZUBnUAb0VFE1UlmyIEEDLqaAXKABGsWNEx5UoAD6gA5DXTZkveYgC+iRJACuqXlWkFqkZAHNd2TAApYwgFZDyfWgEoGWxCbYWrt+lZ2TkweV0FQZV1MDTcAbiA

The thing is that now nothing works, neither 'strict' nor true are acceptable values now. I would expect for both of them to be valid.

This only seems to occur within interfaces, if this is defined with an object it works without any problems.

@mrkev
Copy link
Contributor

mrkev commented Apr 23, 2018

Duplicate of #3876

@mrkev mrkev marked this as a duplicate of #3876 Apr 23, 2018
@mrkev mrkev closed this as completed Apr 23, 2018
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

2 participants