Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
Closes scala#9685
  • Loading branch information
nicolasstucki authored and bishabosha committed Oct 18, 2022
1 parent 97eef14 commit 344ecf6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/neg-macros/i9685.check
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
11 changes: 11 additions & 0 deletions tests/neg-macros/i9685/Macros_1.scala
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) }
}
4 changes: 4 additions & 0 deletions tests/neg-macros/i9685/Test_2.scala
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
}

0 comments on commit 344ecf6

Please sign in to comment.