Skip to content

Support ExpressibleByNilLiteral#64

Open
stephencelis wants to merge 1 commit intomainfrom
expressible-by-nil-literal
Open

Support ExpressibleByNilLiteral#64
stephencelis wants to merge 1 commit intomainfrom
expressible-by-nil-literal

Conversation

@stephencelis
Copy link
Copy Markdown
Member

Just for discussion for now. The use case seems appropriate, but given optional promotion in the language, maybe it's best to avoid potential type-checking issues.

Just for discussion for now. The use case seems appropriate, but given
optional promotion in the language, maybe it's best to avoid potential
type-checking issues.
Copy link
Copy Markdown

@benjohnbarnes benjohnbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the Tagged's other conformances have unit tests. Potentially one could be added here?

@x-sheep
Copy link
Copy Markdown
Contributor

x-sheep commented Apr 7, 2025

This PR seems to promote the idea of wrapping an Optional type into a Tagged type (e.g. Tagged<Tag, Int?>), while I think it's a much better idea to wrap a Tagged type into an Optional type (e.g. Tagged<Tag, Int>?).

If Optional and Tagged both allow to be constructed by assigning nil, it might not be clear which of the two constructors will be called.

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

Successfully merging this pull request may close these issues.

3 participants