diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-02-13 17:01:36 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-02-14 07:51:39 +0100 |
commit | c11cf0b6c55cc2ec15820dceb6ba825726deed88 (patch) | |
tree | 8c8be976b8bb06f85bdad2364d6b62dce6ae9c5d /test/files/run/t7120b.scala | |
parent | bafebe1c161f8db0be758c30fe5cc51082a56427 (diff) | |
download | scala-c11cf0b6c55cc2ec15820dceb6ba825726deed88.tar.gz scala-c11cf0b6c55cc2ec15820dceb6ba825726deed88.tar.bz2 scala-c11cf0b6c55cc2ec15820dceb6ba825726deed88.zip |
SI-7120 Erasure must honor typeref prefixes
Erasure was discarding these, which led to unnecessarily
wide types in quite particular circumstances. This showed
up as a double definition error in the reported bug when the
bridge method clashed with the erased signature.
Diffstat (limited to 'test/files/run/t7120b.scala')
-rw-r--r-- | test/files/run/t7120b.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/t7120b.scala b/test/files/run/t7120b.scala new file mode 100644 index 0000000000..9f6591aa06 --- /dev/null +++ b/test/files/run/t7120b.scala @@ -0,0 +1,27 @@ +trait Base[A] { type B = A; } +class C extends Base[String] { + class D { + def foo[B1 <: B](b: B1) = 0 + } +} + +trait BaseHK[M[_], A] { type B = M[A]; } +object BaseHK { type Id[X] = X } +class CHK extends BaseHK[BaseHK.Id, String] { + class D { + def foo[B1 <: B](b: B1) = 0 + } +} + + +object Test extends App { + val c = new C + val d = new c.D() + val meth = d.getClass.getMethods.find(_.getName == "foo").get + println(meth) + + val chk = new CHK + val dhk = new chk.D() + val methhk = d.getClass.getMethods.find(_.getName == "foo").get + println(methhk) +} |