Skip to content

Refactor FlexibleType to use TypeBounds instead of case class#26245

Draft
HarrisL2 wants to merge 2 commits into
scala:mainfrom
HarrisL2:type-apply-flexible-type
Draft

Refactor FlexibleType to use TypeBounds instead of case class#26245
HarrisL2 wants to merge 2 commits into
scala:mainfrom
HarrisL2:type-apply-flexible-type

Conversation

@HarrisL2
Copy link
Copy Markdown
Contributor

@HarrisL2 HarrisL2 commented Jun 5, 2026

Refactors FlexibleTypes to have TypeBounds as underlying representation, which can help with macro-related code avoid match errors.

The key change is in Definitions.scala

How much have you relied on LLM-based tools in this contribution?

Minimally, for some refactoring

How was the solution tested?

Covered by existing tests (this is a refactoring)

@sjrd
Copy link
Copy Markdown
Member

sjrd commented Jun 5, 2026

I don't think this is going in the right direction. Superficially, this may allow some macro test suites to pass in the short term. But the logic will probably be broken anyway. And in the long term, this will just force macros to handle flexible type specially anyway, like the compiler. IMO we should stick with the correct design with real FlexibleType, and adjust the few macros that have chosen to pattern match on type shapes. That is fragile, and will eventually fail for other reasons.

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