Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/backend/jvm/CodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class CodeGen(val int: DottyBackendInterface, val primitives: DottyPrimitives)(
registerGeneratedClass(mirrorClassNode, isArtifact = true)
catch
case ex: InterruptedException => throw ex
case ex: CompilationUnit.SuspendException => throw ex
case ex: Throwable =>
ex.printStackTrace()
report.error(s"Error while emitting ${unit.source}\n${ex.getMessage}", NoSourcePosition)
Expand Down
13 changes: 13 additions & 0 deletions tests/pos-macros/i21983/Test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package example

sealed trait Test

object Test {
case object Foo extends Test

val visitorType = mkVisitorType[Test]

trait Visitor[A] {
type V[a] = visitorType.Out[a]
}
}
3 changes: 3 additions & 0 deletions tests/pos-macros/i21983/UsesTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package example

val _ = Test.Foo
13 changes: 13 additions & 0 deletions tests/pos-macros/i21983/VisitorMacros.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package example

import scala.deriving.Mirror
import scala.quoted.*

private def mkVisitorTypeImpl[T: Type](using q: Quotes): Expr[VisitorType[T]] =
'{new VisitorType[T]{}}

transparent inline def mkVisitorType[T]: VisitorType[T] = ${ mkVisitorTypeImpl[T] }

trait VisitorType[T] {
type Out[A]
}