Skip to content

Fix SAM conversion crash on @VarArgs trait method#26141

Merged
odersky merged 2 commits into
scala:mainfrom
nox213:fix-i25600
May 30, 2026
Merged

Fix SAM conversion crash on @VarArgs trait method#26141
odersky merged 2 commits into
scala:mainfrom
nox213:fix-i25600

Conversation

@nox213
Copy link
Copy Markdown
Contributor

@nox213 nox213 commented May 22, 2026

Fixes #25600

The varargs forwarder is synthesized with the Deferred flag, which makes the code below crash since possibleSamMethods returns two methods:

// from ExpandSams.scala
val Seq(samDenot) = tpe1.possibleSamMethods

This PR removes Deferred flag when synthesizes varargs forwarder.

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

Extensively, for finding root cause

How was the solution tested?

reproducer

@nox213 nox213 changed the title Fix i25600 Fix SAM conversion crash on @VarArgs trait method May 22, 2026
@Gedochao Gedochao requested a review from odersky May 28, 2026 06:55
@odersky odersky merged commit 9eee09e into scala:main May 30, 2026
45 checks passed
@nox213 nox213 deleted the fix-i25600 branch May 31, 2026 04:00
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.

crash when implementing varargs trait

2 participants