Skip to content

Deprecate ImplicitNotFound, drop its use from macro engine#866

Open
halotukozak wants to merge 1 commit into
masterfrom
deprecate-implicit-not-found
Open

Deprecate ImplicitNotFound, drop its use from macro engine#866
halotukozak wants to merge 1 commit into
masterfrom
deprecate-implicit-not-found

Conversation

@halotukozak

Copy link
Copy Markdown
Contributor

What

ImplicitNotFound provided composed implicit-not-found messages resolved via implicit search. The macro engine now reads the native @implicitNotFound annotation directly off the type symbol, so the proxy mechanism is no longer needed.

Changes

  • Deprecate ImplicitNotFound trait + apply/dummy, and the notFound / notFoundForTry proxy defs (MetadataCompanion, BoundedMetadataCompanion, AsRaw, AsReal). Kept for binary compatibility.
  • MacroCommons.implicitNotFoundMsg now reads native @implicitNotFound (${T} substitution only). Removed ImplicitNotFoundCls/ImplicitNotFoundSym, the proxy lookup, replaceArgs, and the recursive overload.
  • Rewrote ImplicitNotFoundTest to cover the native-message path through infer.

Behavior change

Native @implicitNotFound has no #{param} composition. Composed messages (Lazy[T], AsRaw/AsReal[Try]) now fall back to each type's own static native message.

Verification

commons-macros + commons-core compile clean under -Xfatal-warnings (no deprecation leak); ImplicitNotFoundTest passes.

🤖 Generated with Claude Code

ImplicitNotFound provided composed implicit-not-found messages resolved
via implicit search. The macro engine now reads the native
@implicitNotFound annotation directly off the type symbol, so the proxy
mechanism is no longer needed.

- Deprecate ImplicitNotFound trait + apply/dummy and the notFound /
  notFoundForTry proxy defs; keep them for binary compatibility.
- MacroCommons.implicitNotFoundMsg now reads native @implicitNotFound
  (${T} substitution only); removed proxy lookup, replaceArgs and the
  recursive overload. Native annotation has no #{param} composition, so
  composed messages fall back to each type's own static message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@halotukozak halotukozak self-assigned this Jun 1, 2026
@halotukozak halotukozak added this to the Scala 3 milestone Jun 1, 2026
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.

1 participant