fix: support variance for type parameters of opaque types in Scala 3 (Issue #548)#578
Open
Erichhhhhcat wants to merge 1 commit intozio:developfrom
Open
fix: support variance for type parameters of opaque types in Scala 3 (Issue #548)#578Erichhhhhcat wants to merge 1 commit intozio:developfrom
Erichhhhhcat wants to merge 1 commit intozio:developfrom
Conversation
Fixes issue zio#548 - Scala 3: support variance reading for opaque types For opaque type aliases, declaredTypes returns an empty list because the type parameters are not 'declared' in the traditional sense. This fix adds a fallback to use typeSymbol.typeParams to extract variance information for opaque types.
Member
|
@Erichhhhhcat Hi, thanks for your contribution! 🙏 Could you please add a test case to scala-3 specific LightTypeTagTest.scala demonstrating the fix? |
Erichhhhhcat
added a commit
to Erichhhhhcat/claude-agent-framework
that referenced
this pull request
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue #548 - Scala 3: support variance reading for opaque types
Problem
For opaque type aliases in Scala 3,
declaredTypesreturns an empty list because the type parameters are not 'declared' in the traditional sense. This caused variance detection to fail:Solution
Added a fallback to use
typeSymbol.typeParamsto extract variance information whendeclaredTypesis empty and the symbol is an opaque alias.Testing
This fix enables correct variance detection for opaque types in Scala 3.