-
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.
Backport "Add hint for nested quotes missing staged
Quotes
" to LTS (#…
- Loading branch information
Showing
3 changed files
with
17 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,9 @@ | ||
-- Error: tests/neg-macros/i17338.scala:4:5 ---------------------------------------------------------------------------- | ||
4 | '{ '{ 1 } } // error | ||
| ^ | ||
| access to parameter quotes from wrong staging level: | ||
| - the definition is at level 0, | ||
| - but the access is at level 1. | ||
| | ||
| Hint: Nested quote needs a local context defined at level 1. | ||
| One way to introduce this context is to give the outer quote the type `Expr[Quotes ?=> Expr[T]]`. |
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,4 @@ | ||
import scala.quoted.* | ||
|
||
def test(using quotes: Quotes): Expr[Expr[Int]] = | ||
'{ '{ 1 } } // error |