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

Improve allowMultipleConnections together with InterfaceTypes #248

Closed
newcat opened this issue Jan 22, 2023 · 1 comment
Closed

Improve allowMultipleConnections together with InterfaceTypes #248

newcat opened this issue Jan 22, 2023 · 1 comment
Labels
bug Something isn't working v2 Related to Baklava v2

Comments

@newcat
Copy link
Owner

newcat commented Jan 22, 2023

Hi,
I've noticed an oddity when using Interface Types with allowMultipleConnections.

So let's say I'd like my custom interface to receive strings, so I use new NodeInterfaceType<string>("custom").
Then I set this type and allow multiple connections:
new NodeInterface<string[]>("Input", []).use(allowMultipleConnections).use(setType, customType)

Then I'll have a typescript error about the mismatch between 'string' and 'string[]':
Argument of type 'NodeInterfaceType<string>' is not assignable to parameter of type 'NodeInterfaceType<string[]>'.ts(2345)

I could change my type to NodeInterfaceType<string[]>, but then, if I wanted an output node of the same 'custom' type, that will also be 'string[]' instead of 'string' which seems wrong.

What's the recommended way to do this? Am I supposed to put the [] into the interface definition?

Originally posted by @hthomas92 in #219 (comment)

@newcat newcat added bug Something isn't working v2 Related to Baklava v2 labels Jan 22, 2023
@newcat
Copy link
Owner Author

newcat commented Jan 2, 2024

Fixed in v2.3.0

@newcat newcat closed this as completed Jan 2, 2024
@newcat newcat added this to V2 Apr 9, 2024
@newcat newcat moved this to Done in V2 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 Related to Baklava v2
Projects
Status: Done
Development

No branches or pull requests

1 participant