Skip to content

Properly solve capture set during box adaptation#25902

Merged
Linyxus merged 3 commits intoscala:mainfrom
dotty-staging:fix-i25863
Apr 27, 2026
Merged

Properly solve capture set during box adaptation#25902
Linyxus merged 3 commits intoscala:mainfrom
dotty-staging:fix-i25863

Conversation

@Linyxus
Copy link
Copy Markdown
Contributor

@Linyxus Linyxus commented Apr 22, 2026

Fixes #25863.

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

Extensively, for emotional support.

How was the solution tested?

  • New automated tests
  • and covered by existing tests

@Linyxus Linyxus requested a review from odersky April 22, 2026 13:57
@odersky
Copy link
Copy Markdown
Contributor

odersky commented Apr 26, 2026

Seems stdlib is not compiling with this change anymore. Can we fix it?

@Linyxus
Copy link
Copy Markdown
Contributor Author

Linyxus commented Apr 26, 2026

Yes, I was planning to look into that but got distracted. Will work on it.

@Linyxus Linyxus assigned Linyxus and unassigned odersky Apr 26, 2026
Needs a type ascription on an `Iterable.empty`.
@odersky odersky requested a review from a team as a code owner April 26, 2026 17:44
@odersky
Copy link
Copy Markdown
Contributor

odersky commented Apr 26, 2026

I think I have a fix for Iterable.

@odersky odersky requested a review from natsukagami April 26, 2026 21:13
@odersky odersky assigned natsukagami and unassigned Linyxus Apr 26, 2026
@odersky
Copy link
Copy Markdown
Contributor

odersky commented Apr 27, 2026

Seems I can't approve this anymore since I added a commit?

@Linyxus Linyxus merged commit bcddae3 into scala:main Apr 27, 2026
49 of 50 checks passed
@Linyxus Linyxus deleted the fix-i25863 branch April 27, 2026 11:05
Comment on lines +2 to +5
13 | val error = make[File^{file}](fun, file) // error, which is expected
| ^^^
| Found: File^ ->{file} Unit
| Required: File^{file} -> Unit
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why does the error point to fun? It looks confusing, as fun is indeed a pure function.

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.

It's because the box-adapted version of fun is of the Found: type. I agree it's confusing. Maybe we can make an error note for capabilities added to capture sets through box adapation?

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.

Agreed. An error note will be quite desirable.

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.

Leaked capability using higher-order polymorphic function

4 participants