-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rethrow SuspendExceptions caught in CodeGen phase (#22009)
Related PR: #21651 There, a mechanism was added to the Phase classes, where any phase could catch a SuspendException and have a compilation unit suspended (stopped and recompiled later). In this fix, we rethrow incorrectly caught SuspendExceptions, so that the aforementioned mechanism can take care of the rest. Fixes: #21983
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package example | ||
|
||
val _ = Test.Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} |