Skip to content

Conversation

dragos
Copy link

@dragos dragos commented Sep 16, 2025

This came up when upgrading our code base from an older vesion of mainargs, where we relied on chaining TokenReaders for Map and Seq. The implicit conversions require TokensReader.Simple as argument, but return the superclass TokensReader, which makes chaining impossible. Since the implementation is actually using the narrow type, we just expose it in the implicit def signature to make chaining work again.

This came up when upgrading our code base from an older vesion of mainargs, where we relied on chaining TokenReaders for Map and Seq. The implicit conversions require `TokensReader.Simple` as argument, but return the superclass `TokensReader`, which makes chaining impossible. Since the implementation is actually using the narrow type, we just expose it in the implicit def signature to make chaining work again.
@dragos
Copy link
Author

dragos commented Sep 17, 2025

I think the binary incompatibility is "by design", what can we do for this kind of changes?

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.

1 participant