-
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.
Merge pull request #15025 from dotty-staging/close-9685
Add regression test
- Loading branch information
Showing
3 changed files
with
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
-- [E008] Not Found Error: tests/neg-macros/i9685/Test_2.scala:3:4 ----------------------------------------------------- | ||
3 | 1.asdf // error | ||
| ^^^^^^ | ||
| value asdf is not a member of Int |
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,11 @@ | ||
import scala.language.implicitConversions | ||
|
||
class Clue[+T](val value: T) | ||
|
||
object Clue { | ||
import scala.quoted._ | ||
|
||
inline implicit def generate[T](value: T): Clue[T] = ${ clueImpl('value) } | ||
|
||
def clueImpl[T:Type](value: Expr[T])(using Quotes): Expr[Clue[T]] = '{ new Clue($value) } | ||
} |
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 @@ | ||
object Main { | ||
def toClue[A](a: A): Clue[A] = Clue.generate(a) | ||
1.asdf // error | ||
} |