diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-08-27 01:18:52 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-08-27 01:18:52 +1000 |
commit | f6467d063167da3a34ac92957d3a308d2a230926 (patch) | |
tree | 9244a5542cc3b26b0a2b05e90c36e0744b971a05 /test/files/run | |
parent | 47908f19e064151140e32819c2edd9e68b34dd0c (diff) | |
download | scala-f6467d063167da3a34ac92957d3a308d2a230926.tar.gz scala-f6467d063167da3a34ac92957d3a308d2a230926.tar.bz2 scala-f6467d063167da3a34ac92957d3a308d2a230926.zip |
SI-8823 Exclude specialized methods from extension method rewrite
If a value class extends a specialized class, it can sprout
specialized members after the specialization info transformer has run.
However, we only install extension methods for class members we know
about at the extmethods phase.
This commit simply disables rewiring calls to these methods in
erasure to an extention method. This follows the approach taken
from super accessors.
Note: value class type parameters themselves currently are not
allowed to be specialized.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t8823.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/t8823.scala b/test/files/run/t8823.scala new file mode 100644 index 0000000000..0ac653566a --- /dev/null +++ b/test/files/run/t8823.scala @@ -0,0 +1,10 @@ +class Tuple2Int(val encoding: Long) extends AnyVal with Product2[Int, Int] { + def canEqual(that: Any) = false + def _1: Int = 1 + def _2: Int = 2 +} + +object Test extends App { + assert(new Tuple2Int(0)._1 == 1) + assert(new Tuple2Int(0)._2 == 2) +} |