diff options
author | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-02-06 15:20:37 +0100 |
---|---|---|
committer | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-02-06 15:20:37 +0100 |
commit | 8994da9da0b57d24d632f4eab2cd8c17c530f279 (patch) | |
tree | 806eb0fe27cb2974ade04443eb85397f713164b2 /test/files/scalacheck | |
parent | fc15cfc2399661f1de7d91b2ca0f5d12f32bc708 (diff) | |
download | scala-8994da9da0b57d24d632f4eab2cd8c17c530f279.tar.gz scala-8994da9da0b57d24d632f4eab2cd8c17c530f279.tar.bz2 scala-8994da9da0b57d24d632f4eab2cd8c17c530f279.zip |
Fix inconsistent binding in patterns with 10+ holes
Previously a map that was storing bindings of fresh hole variables with
their contents (tree & cardinality) used to be a SortedMap which had
issues with inconsistent key ordering:
"$fresh$prefix$1" < "$fresh$prefix$2"
...
"$fresh$prefix$8" < "$fresh$prefix$9"
"$fresh$prefix$9" > "$fresh$prefix$10"
This issue is solved by using a LinkedHashMap instead (keys are inserted
in the proper order.)
Diffstat (limited to 'test/files/scalacheck')
-rw-r--r-- | test/files/scalacheck/quasiquotes/TermConstructionProps.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala index 54187d68c2..145e51ab68 100644 --- a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala @@ -291,4 +291,9 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") { val stats2 = List.empty[Tree] assert(q"{ ..$stats2 }" ≈ q"") } + + property("consistent variable order") = test { + val q"$a = $b = $c = $d = $e = $f = $g = $h = $k = $l" = q"a = b = c = d = e = f = g = h = k = l" + assert(a ≈ q"a" && b ≈ q"b" && c ≈ q"c" && d ≈ q"d" && e ≈ q"e" && g ≈ q"g" && h ≈ q"h" && k ≈ q"k" && l ≈ q"l") + } } |