diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-20 23:45:48 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-03-21 00:33:39 +0100 |
commit | 6135363f8730421202eeb39494d3720b9124131c (patch) | |
tree | fe8d99d999be7ab7e844091e34fca216c2343dcb /tests | |
parent | f45dbe7e3722f0c6a814c8afd8481690ac5f1d2c (diff) | |
download | dotty-6135363f8730421202eeb39494d3720b9124131c.tar.gz dotty-6135363f8730421202eeb39494d3720b9124131c.tar.bz2 dotty-6135363f8730421202eeb39494d3720b9124131c.zip |
Fix desugaring of variable pattern leaking into API
This was especially bad for incremental compilation since the temporary
variable name is unstable.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/variable-pattern-access.check | 7 | ||||
-rw-r--r-- | tests/run/variable-pattern-access.scala | 16 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/run/variable-pattern-access.check b/tests/run/variable-pattern-access.check new file mode 100644 index 000000000..1039f6a25 --- /dev/null +++ b/tests/run/variable-pattern-access.check @@ -0,0 +1,7 @@ +# Fields of A: +private final int A.a$$local +private final int A.b$$local +private final scala.Tuple2 A.$1$ +# Methods of A: +public int A.a() +public int A.b() diff --git a/tests/run/variable-pattern-access.scala b/tests/run/variable-pattern-access.scala new file mode 100644 index 000000000..1d27b3e42 --- /dev/null +++ b/tests/run/variable-pattern-access.scala @@ -0,0 +1,16 @@ +class A { + val (a, b) = (1, 2) +} +object Test { + def printFields(cls: Class[_]) = + println(cls.getDeclaredFields.map(_.toString).sorted.deep.mkString("\n")) + def printMethods(cls: Class[_]) = + println(cls.getDeclaredMethods.map(_.toString).sorted.deep.mkString("\n")) + + def main(args: Array[String]): Unit = { + println("# Fields of A:") + printFields(classOf[A]) + println("# Methods of A:") + printMethods(classOf[A]) + } +} |