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

Option for not failing exhaustiveness check if all implementations of the sumtype are covered by interfaces #15

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

jvmakine
Copy link
Contributor

No description provided.

Previously, the check would panic with nil pointer exception. Now, we print out the expression that can not be typed
…faces into account.

If this option is used, and the switch case contains interfaces for all implementations of the sealed type, the check passes.
Any struct implementing these interfaces also implement the root subtype, so these should not be required in the switcch case
@alecthomas
Copy link
Owner

Nice!

@alecthomas alecthomas merged commit 468e7aa into alecthomas:master Dec 12, 2024
2 checks passed
@jvmakine jvmakine deleted the juho/deal-with-hierarchies branch December 12, 2024 05:34
jvmakine added a commit to TBD54566975/ftl that referenced this pull request Dec 12, 2024
Next, will use this to get rid of the manual `ProvisionerEvent`

Blocked by alecthomas/go-check-sumtype#15
jvmakine added a commit to TBD54566975/ftl that referenced this pull request Dec 13, 2024
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.

2 participants