Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for helping with this!
At first glance it seems okay. I would maybe put the more specific overload first, and this one after it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think you could maybe add a special interpolation type that excludes functions, so people can still use interpolation inside the templates. Something like this:
but from the top of my head, I am not sure if that will cause issues with inference, though
P.S: Maybe even accepting functions that don't accept any arguments could be added, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omninonsense sorry for the delay, I've tried to pick this up again but am getting a bit lost
if I put lines 251-253 lower down then the overload currently on line 254 is matched first and flow complains about "Missing type annotation for Theme, StyleProps:.
I think you meant to add a
...
in? Like this?Also, for some reason I've tried various combinations of the above (including my original code) but am still getting this error:
maybe you have time to check the branch out or for a quick call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully this is recreating the error I'm seeing, will try to debug now:
https://flow.org/try/#0PTAEAEDMBsHsHcBQBLAtgB1gJwC6gEoCmAhgMZ6RayqgDkWJ5tA3IojgJ7qGgDKn0QgBNeAC2w5RxAHZCAYmRzYOAHgBqAPlABeUAAoAlDq0yOrTt1ABRAB44sisRKmydodRr1qj2rfw6CIuK4LvKKyh6s7Fw8AEIArsjQOMjSVoKohNI4AJLSAM44MqSE+W4A3oig1aBCyABuAFwEjDgAJOmEmdlEkCq0dfW0GogAvmwWPADCsNL1WchZOE4hMkJlum0A8gBGAFYAssToKlU1CUkpaRlLeYXFpQA0Z9W29o7BkmtnGlGks4VQIUAsJmjM5gslisvrINqBKgBIQbNQzGdyDUDAEbjRCEGyYXCgf4FPAHDgAEQabmBgQAdINWEA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! On line 20 of the try-flow link, you forgot to call it (also tweaked the function signature to resemble a template literal, so flow doesn't complain about that then):
https://flow.org/try/#0PTAEAEDMBsHsHcBQBLAtgB1gJwC6gEoCmAhgMZ6RayqgDkWJ5tA3IojgJ7qGgDKn0QgBNeAC2w5RxAHZCAYmRzYOAHgBqAPlABeUAAoAzjizJpAcwDaAXQA0oAHSOZHawEodW5607dQAUQAPY0UxCSlZHVB1DT01d20tfg5BEXFccPlFZWjWdi4eACEAV2RoHFM-QVRCaRwASWkjGVJCA0iAb0RQbtAhZAA3AC4CRhwAEkrCatqiSBVaPv7aDUQAXzYfHgBhWGl+muQanFD0mSE23TGAeQAjACsAWWJ0FS6e4tLy6Unp+sacZqtGxvbqBYLkE6SM5vDS5Ui7IygIzJYTDHZ7A5HSEZC6gToASEWwz08S0KkWoGAK3WiEIAUwuFA8P+oAeHAAIgNIsiUvZFgADfmsIA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is still strange though, lmao.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I forgot the spread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers, though this solves the issue on this simplified example I still have the same error in my branch. As you say, the error seems strange. I don't think this is intended so I've raised a bug against Flow.
facebook/flow#8344