-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Preserve expected type when parsing 'let' expressions #7301
Conversation
Confirmed that the error goes away with this change |
Awesome! This is a really good candidate for an expression regression test -- you can start from one of the existing "let" tests, and use add a "propertySpec" entry to the test.json to specify the expected type. |
@ChrisLoer I added a test that's passing. Does that look right to you? |
Yeah, that looks right to me! Did you double-check that the test also fails if you revert your change? You could probably make the test a little more focused/easier to read by getting rid of the nested interpolate? Just one interpolate expression ought to be enough to exercise the functionality. I've also started trying to annotate some of our render/query/expression tests with a "description" field that describes what's going on in the test (in this case something like "'let' should preserve expected type for child expressions. If it didn't, this test case would fail because the expected "color" type would not get passed into the interpolate and the literal strings wouldn't automatically coerce to the color type"). If you think this is ready for review, I'm ready to 🍏. |
I simplified the test, added a description and confirmed that the test fails if I revert the change in the |
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.
🚀
Launch Checklist
Fixes #7300