Skip to content

Fluidify explicit self types for non-CC classes#25639

Open
Linyxus wants to merge 3 commits intoscala:mainfrom
dotty-staging:cc-fluidify-self-type
Open

Fluidify explicit self types for non-CC classes#25639
Linyxus wants to merge 3 commits intoscala:mainfrom
dotty-staging:cc-fluidify-self-type

Conversation

@Linyxus
Copy link
Copy Markdown
Contributor

@Linyxus Linyxus commented Mar 27, 2026

Fixes #25634.

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

I used GPT-5.4 to pinpoint the root and produce a fix.

How was the solution tested?

Human eyes and testCompilation.

Additional notes

@Linyxus Linyxus requested a review from odersky March 28, 2026 07:00
@Linyxus Linyxus requested a review from noti0na1 March 28, 2026 07:03
@Linyxus Linyxus requested a review from odersky March 28, 2026 15:59
private def fluidify(using Context) = new TypeMap:
def apply(t: Type): Type = t match
case cinfo: ClassInfo =>
val selfInfo1: TypeOrSymbol = cinfo.selfInfo match
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use givenSelfTyoe here to simplify the logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I wasn't aware of this helper! Thanks.

... and use the beautiful colon syntax. So elegant.
@Linyxus Linyxus requested a review from odersky March 28, 2026 19:34
@Linyxus
Copy link
Copy Markdown
Contributor Author

Linyxus commented Mar 30, 2026

@odersky ping for review

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.

The self type of a class compiled without CC is not treated as fluid in CC

2 participants