Skip to content

Commit

Permalink
Merge pull request #15025 from dotty-staging/close-9685
Browse files Browse the repository at this point in the history
Add regression test
  • Loading branch information
anatoliykmetyuk authored May 5, 2022
2 parents 18e8a18 + 3560d65 commit 84dd54d
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 84dd54d

Please sign in to comment.