Skip to content

Commit 9a00d2b

Browse files
committed
Merge 2.10.x into master.
Conflicts: src/compiler/scala/tools/nsc/transform/Erasure.scala
2 parents 6ad7de4 + 1a84c86 commit 9a00d2b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/compiler/scala/tools/nsc/transform/Erasure.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ abstract class Erasure extends AddInterfaces
447447
def checkPair(member: Symbol, other: Symbol) {
448448
val otpe = specialErasure(root)(other.tpe)
449449
val bridgeNeeded = exitingErasure (
450+
!member.isMacro &&
450451
!(other.tpe =:= member.tpe) &&
451452
!(deconstMap(other.tpe) =:= deconstMap(member.tpe)) &&
452453
{ var e = bridgesScope.lookupEntry(member.name)

test/files/pos/t7190.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import scala.language.experimental.macros
2+
import scala.reflect.macros._
3+
4+
trait A[T] {
5+
def min[U >: T](implicit ord: Numeric[U]): T = macro A.min[T, U]
6+
}
7+
8+
object A {
9+
def min[T: c.WeakTypeTag, U >: T: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[T] = {
10+
c.universe.reify {
11+
ord.splice.zero.asInstanceOf[T]
12+
}
13+
}
14+
}
15+
16+
class B extends A[Int] {
17+
override def min[U >: Int](implicit ord: Numeric[U]): Int = macro B.min[U]
18+
}
19+
20+
object B {
21+
def min[U >: Int: c.WeakTypeTag](c: Context)(ord: c.Expr[Numeric[U]]): c.Expr[Int] = {
22+
c.universe.reify {
23+
ord.splice.zero.asInstanceOf[Int]
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)