Skip to content

Revert #24431#25703

Merged
mbovel merged 3 commits intoscala:mainfrom
mbovel:mb/revert-d8c87a7
Apr 3, 2026
Merged

Revert #24431#25703
mbovel merged 3 commits intoscala:mainfrom
mbovel:mb/revert-d8c87a7

Conversation

@mbovel
Copy link
Copy Markdown
Member

@mbovel mbovel commented Apr 3, 2026

Given the wide scope of the regression introduced by #24431, I think it's best to revert for now, until I figure out how to fix it.

Closes #25690, closes #25692 and closes #25697.

@mbovel mbovel force-pushed the mb/revert-d8c87a7 branch from e4dc487 to 2168115 Compare April 3, 2026 10:49
@mbovel mbovel requested a review from WojciechMazur April 3, 2026 10:49
@mbovel
Copy link
Copy Markdown
Member Author

mbovel commented Apr 3, 2026

Thanks for documenting these regressions Wojciech and sorry for the trouble!

@WojciechMazur
Copy link
Copy Markdown
Contributor

If possible let's add the snippets the 3 PRs as future regression tests

@mbovel mbovel force-pushed the mb/revert-d8c87a7 branch from 1cb547a to da3c023 Compare April 3, 2026 11:07
@WojciechMazur WojciechMazur added this to the 3.8.4 milestone Apr 3, 2026
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Apr 3, 2026
@mbovel
Copy link
Copy Markdown
Member Author

mbovel commented Apr 3, 2026

Regression test for #25690 doesn't pass with -Xcheck-macros:

completed (2/3, 0 failed, 1s)-- Error: tests/pos-macros/i25690/Test_2.scala:4:11 --------------------------------------------------------------------
 4 |val u = uio(42) // errortrapped / Test / testOnly 5s
   |        ^^^^^^^
   |Malformed tree was found while expanding macro with -Xcheck-macros.
   |The tree does not conform to the compiler's tree invariants.
   |
   |Macro was:
   |scala.quoted.runtime.Expr.splice[Tracer.instance.Type](((contextual$1: scala.quoted.Quotes) ?=> Tracer.autoTraceImpl(contextual$1)))
   |
   |The macro returned:
   |("loc": Tracer.instance.Type)
   |
   |Error:
   |assertion failed: Type Mismatch (while checking adapt):
   |Found:    ("loc" : String)
   |Required: Tracer.instance.Type
   |I tried to show that
   |  ("loc" : String)
   |conforms to
   |  Tracer.instance.Type
   |but none of the attempts shown below succeeded:
   |
   |  ==> ("loc" : String)  <:  Tracer.instance.Type
   |    ==> ("loc" : String)  <:  Nothing
   |      ==> String  <:  Nothing  = false
   |    ==> String  <:  Tracer.instance.Type
   |      ==> String  <:  Nothing  = false
   |
   |The tests were made under the empty constraint
   |tree = "loc" Literal
   |
   |stacktrace available when compiling with `-Ydebug`
   |--------------------------------------------------------------------------------------------------------------------
   |Inline stack trace
   |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   |This location contains code that was inlined from Macro_1.scala:10
10 |  inline def autoTrace: Trace = ${ autoTraceImpl }
   |                                ^^^^^^^^^^^^^^^^^^
   |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   |This location contains code that was inlined from Macro_1.scala:10
 2 |inline def uio[A](a: A): A = succeed(a)(Tracer.autoTrace)
   |                                        ^^^^^^^^^^^^^^^^
    --------------------------------------------------------------------------------------------------------------------

Looking at it now.

Avoid producing a Typed node that -Xcheck-macros cannot verify
for path-dependent types, while still reproducing the regression
without the revert.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mbovel mbovel enabled auto-merge April 3, 2026 13:39
@mbovel mbovel merged commit a7f6cae into scala:main Apr 3, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.

Projects

None yet

2 participants