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

Unknown type issue from Beta 4 #135

Closed
vitaly-t opened this issue Oct 4, 2022 · 9 comments
Closed

Unknown type issue from Beta 4 #135

vitaly-t opened this issue Oct 4, 2022 · 9 comments

Comments

@vitaly-t
Copy link
Owner

vitaly-t commented Oct 4, 2022

@RebeccaStevens

After PR #132, it seems, we start getting unknown type resolved...

image

See 2.0.0.0-beta 4 version published.

UPDATE

Actually, after some time, my IDE started showing spread with correct type, but not flat:

image

@RebeccaStevens
Copy link
Collaborator

Yeah, I suspected there would be problems like this. I'll be working on that next.
I'm working on finishing up the 5.0 release of eslint-plugin-functional.

@vitaly-t
Copy link
Owner Author

vitaly-t commented Oct 5, 2022

After playing with it a bit more, I'm seeing my IDE (WebStorm) getting confused about types a lot. It was showing correctly for one operator, then suddenly stopped :) I don't know what to make of it :)

@vitaly-t
Copy link
Owner Author

vitaly-t commented Oct 13, 2022

@RebeccaStevens Just re-tested it against v2.0.0-beta.6

Looks like types for flat and flatMap types are resolved correctly now, but not for spread, which produces unknown type.

image

@RebeccaStevens
Copy link
Collaborator

RebeccaStevens commented Oct 13, 2022

Isn't that expected as 1, 2 and 3 are not iterable?

This should work though:

const data = [[1, 2, 3]];
const i = pipe(data, spread());

@vitaly-t
Copy link
Owner Author

vitaly-t commented Oct 13, 2022

Isn't that expected as 1, 2 and 3 are not iterable?

Yes, you are right. What actually confused me is that in v1.6.4 it would complain about incorrect input:

image

But with v2.0.0-beta.6 it does not complain anymore, which isn't ideal, makes you think that your use of operator is correct, even though it is not. I mean, it confused me, it will surely confuse other developers.

@RebeccaStevens
Copy link
Collaborator

RebeccaStevens commented Oct 13, 2022

When I tried that code, it also complained just like it did in v1.6.4

test/ops/spread/types/sync.test-d.ts

image

@vitaly-t
Copy link
Owner Author

That's odd. I can see that error inside the library tests also, but not inside clients. Tried to clean up the cache - didn't help. Latest TypeScript, latest WebStorm, errors for v1.6.4, not for v2.0.0-beta.6

Any idea? :)

@vitaly-t
Copy link
Owner Author

@RebeccaStevens If you are certain that there is no issue there, then feel free to close this issue ;)

@RebeccaStevens
Copy link
Collaborator

image

I'm getting the error, so I think everything is working as exoected.

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