Closed as duplicate of#22649
Closed as duplicate of#22649
Description
Compiler version
3.7.0 (and earlier and later)
Found when working on scaladoc
Minimized code
object Test:
type R = { type T; val x: Int; type U <: this.T; }
def main() = Macro.show[R]
import scala.quoted._
object Macro:
inline def show[T] = ${ showImpl[T] }
def showImpl[T: Type](using Quotes): Expr[Unit] =
import quotes.reflect._
println(TypeRepr.of[T].dealias.show(using Printer.TypeReprStructure))
'{()}
Output
-- Error: /Users/jchyb/workspace/scala3/Test.scala:5:25 -------------------------
5 | def main() = Macro.show[R]
| ^^^^^^^^^^^^^
| Exception occurred while executing macro expansion.
| java.lang.StackOverflowError
|
|-----------------------------------------------------------------------------
|Inline stack trace
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from Macro.scala:3
3 | inline def show[T] = ${ showImpl[T] }
| ^^^^^^^^^^^^^^^^
-----------------------------------------------------------------------------
Expectation
No error