aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/pos/t7190.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/disabled/macro/pos/t7190.scala')
-rw-r--r--tests/disabled/macro/pos/t7190.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/disabled/macro/pos/t7190.scala b/tests/disabled/macro/pos/t7190.scala
new file mode 100644
index 000000000..449e5c83f
--- /dev/null
+++ b/tests/disabled/macro/pos/t7190.scala
@@ -0,0 +1,26 @@
+import scala.language.experimental.macros
+import scala.reflect.macros._
+
+trait A[T] {
+ def min[U >: T](implicit ord: Numeric[U]): T = macro A.min[T, U]
+}
+
+object A {
+ def min[T: c.WeakTypeTag, U >: T: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[T] = {
+ c.universe.reify {
+ ord.splice.zero.asInstanceOf[T]
+ }
+ }
+}
+
+class B extends A[Int] {
+ override def min[U >: Int](implicit ord: Numeric[U]): Int = macro B.min[U]
+}
+
+object B {
+ def min[U >: Int: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[Int] = {
+ c.universe.reify {
+ ord.splice.zero.asInstanceOf[Int]
+ }
+ }
+}