diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-01 23:27:54 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-04 18:59:25 +0200 |
commit | 0b50b29cb9e8b43fff1d012dd53561b5ac0a437c (patch) | |
tree | 1682ba5c7df18c9c246d129689bb8db02c94a625 /tests/pos/Bridges.scala | |
parent | 2033b5607a41b77590b8d23bf5c40c906a0b42e7 (diff) | |
download | dotty-0b50b29cb9e8b43fff1d012dd53561b5ac0a437c.tar.gz dotty-0b50b29cb9e8b43fff1d012dd53561b5ac0a437c.tar.bz2 dotty-0b50b29cb9e8b43fff1d012dd53561b5ac0a437c.zip |
Bridge generation in erasure implemented.
Relies on meaning of "override" to see which bridges are required.
Doesn't take in account value classes for now
Uses 'adapt' used by erasure for converting arguments and return value.
Diffstat (limited to 'tests/pos/Bridges.scala')
-rw-r--r-- | tests/pos/Bridges.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pos/Bridges.scala b/tests/pos/Bridges.scala new file mode 100644 index 000000000..a7350d785 --- /dev/null +++ b/tests/pos/Bridges.scala @@ -0,0 +1,11 @@ +abstract class X[T]{ + def go2(x:T)(y:T = x): T = y + def go: T + def go1(x: T) = x +} + +class Y extends X[Int] { + override def go2(x: Int)(z: Int) = 2 + override def go = 0 + override def go1(x: Int) = x +} |