Skip to content

Conversation

@blast-hardcheese
Copy link
Contributor

Why

Introduced in #142, NotRequired[A] | None doesn't typecheck, but we didn't have any codegen tests that exhausted that path.

What changed

Move the statically rendered ${render(...)} | None into ${render(UnionTypeExpr([..., NoneTypeExpr()]))} so the type renderer knows about and can properly unify/deduplicate/render the structured union.

Test plan

TODO: Add a test that makes it so we don't regress here in the future.

@blast-hardcheese blast-hardcheese added the bug Something isn't working label Mar 18, 2025
@blast-hardcheese blast-hardcheese requested a review from a team as a code owner March 18, 2025 05:44
@blast-hardcheese blast-hardcheese requested review from jackyzha0 and ryantm and removed request for a team March 18, 2025 05:44
@blast-hardcheese blast-hardcheese force-pushed the dstewart/bug/notrequired-bug branch from 2dc716e to ef9eacb Compare March 18, 2025 05:44
@jackyzha0
Copy link
Member

can we add a quick codegen test for sanity? looks good otherwise

@blast-hardcheese
Copy link
Contributor Author

Yep -- that's part of the TODO

@blast-hardcheese blast-hardcheese enabled auto-merge (squash) March 18, 2025 19:33
@blast-hardcheese blast-hardcheese force-pushed the dstewart/bug/notrequired-bug branch from dfa7089 to 238a41c Compare March 18, 2025 19:55
@blast-hardcheese blast-hardcheese force-pushed the dstewart/bug/notrequired-bug branch from 238a41c to bcb25f8 Compare March 18, 2025 19:57
@blast-hardcheese blast-hardcheese merged commit 42de571 into main Mar 18, 2025
3 checks passed
@blast-hardcheese blast-hardcheese deleted the dstewart/bug/notrequired-bug branch March 18, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants