aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala')
-rw-r--r--tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala23
1 files changed, 0 insertions, 23 deletions
diff --git a/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala b/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala
deleted file mode 100644
index 7ac8fccc3..000000000
--- a/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-import scala.reflect.macros.blackbox.Context
-import language.experimental.macros
-
-trait Complex[T]
-
-class Foo(val bar: Bar)
-class Bar(val s: String)
-
-object Complex {
- def impl[T: c.WeakTypeTag](c: Context): c.Expr[Complex[T]] = {
- import c.universe._
- val tpe = weakTypeOf[T]
- for (f <- tpe.decls.collect{case f: TermSymbol if f.isParamAccessor && !f.isMethod => f}) {
- val trecur = appliedType(typeOf[Complex[_]], List(f.info))
- val recur = c.inferImplicitValue(trecur, silent = true)
- if (recur == EmptyTree) c.abort(c.enclosingPosition, s"couldn't synthesize $trecur")
- }
- c.Expr[Null](Literal(Constant(null)))
- }
-
- implicit object ComplexString extends Complex[String]
- implicit def genComplex[T]: Complex[T] = macro impl[T]
-}