forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle suspension due to macro call in arbitrary phases (scala#21651)
Previously we only supported suspension in Typer and Inliner. In the added test case this happens in PostTyper, but I've seen it happen in Mixin too. Fixes scala#18517.
- Loading branch information
Showing
5 changed files
with
40 additions
and
12 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
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,17 @@ | ||
package dummy | ||
|
||
trait BG { | ||
val description: { type Structure } | ||
type Structure = description.Structure | ||
} | ||
|
||
abstract class Caller extends BG { | ||
type Foo >: this.type <: this.type | ||
|
||
transparent inline def generate2() = | ||
${Macro.impl() } | ||
|
||
final val description = { | ||
generate2() | ||
} | ||
} |
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,7 @@ | ||
package dummy | ||
|
||
import scala.quoted.* | ||
|
||
object Macro: | ||
def impl()(using quotes:Quotes) : Expr[Any] = | ||
'{ null } |
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,6 @@ | ||
package dummy | ||
|
||
trait User: | ||
final def bar(cell:Any) : Unit = | ||
(cell: cell.type) match | ||
case c: (Caller & cell.type) => () |