Skip to content

Conversation

@dmolesUC
Copy link

@dmolesUC dmolesUC commented Oct 8, 2025

Description

Discussion

I agree with the sentiment expressed in that comment that doing this is not a great idea, and in general, it would be better to define an ad-hoc "interface" type. But there are times when you're dealing with an obnoxious third-party library, and you just need to document something in one place, and introducing a whole type for that feels like overkill.

This is a basic implementation that just covers this use case, but I could see an argument for instead supporting & for intersection types in general (and maybe | as well as , for union types while we're at it), which wouldn't be much more code.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

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