Skip to content

[OpenCB Project Fix] Fixes #26018: Surface diverging implicit error from nested summonInline#26024

Draft
soronpo wants to merge 1 commit into
scala:mainfrom
soronpo:claude/fix-scala-26018-NqOI3
Draft

[OpenCB Project Fix] Fixes #26018: Surface diverging implicit error from nested summonInline#26024
soronpo wants to merge 1 commit into
scala:mainfrom
soronpo:claude/fix-scala-26018-NqOI3

Conversation

@soronpo
Copy link
Copy Markdown
Contributor

@soronpo soronpo commented May 8, 2026

When an inline given's body contains a summonInline[T] that triggers a recursive implicit search of the same type, divergence is correctly detected at the inner search but the buffered error gets wrapped by typedImplicit as a MismatchedImplicit failure ("does not match type"), which is misleading because the displayed candidate would in fact match.

Detect the buffered divergence via a new isDivergingImplicit predicate on MissingImplicitArgument and propagate as DivergingImplicit so the user sees "produces a diverging implicit search" instead.

Fixes #26018

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

Extensively, but it's a small fix.

How was the solution tested?

New automated tests (including the issue's reproducer, if applicable)

@soronpo soronpo marked this pull request as ready for review May 9, 2026 09:04
@soronpo soronpo changed the title Fixes #26018: Surface diverging implicit error from nested summonInline [OpenCB Project Fix] Fixes #26018: Surface diverging implicit error from nested summonInline May 11, 2026
@soronpo soronpo marked this pull request as draft May 11, 2026 13:46
…nInline

When an inline given's body contains a `summonInline[T]` that triggers a
recursive implicit search of the same type, divergence is correctly
detected at the inner search but the buffered error gets wrapped by
`typedImplicit` as a `MismatchedImplicit` failure ("does not match
type"), which is misleading because the displayed candidate would in
fact match.

Detect the buffered divergence via a new `isDivergingImplicit` predicate
on `MissingImplicitArgument` and propagate as `DivergingImplicit` so the
user sees "produces a diverging implicit search" instead.
@soronpo soronpo force-pushed the claude/fix-scala-26018-NqOI3 branch from 560f6cc to f360f92 Compare May 11, 2026 13:51
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.

summonInline[F[_, x.T]] from inline given body: candidate "found but does not match" when T is a type member

2 participants