summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2015-04-10 10:29:11 +0300
committerLukas Rytz <lukas.rytz@typesafe.com>2015-04-10 10:29:11 +0300
commit6e7b32649b041a001fdb61ca184c57e4c8228056 (patch)
treeab3c1142e2a3fcbe9ed5ef674ecac9147b5dcd70 /test/files
parent3cf7c958fdb83258e7ad626f5a6c7fa8a4b2241b (diff)
parent1e7a990e028dffc5fa8ac07a02ff3f79bde24749 (diff)
downloadscala-6e7b32649b041a001fdb61ca184c57e4c8228056.tar.gz
scala-6e7b32649b041a001fdb61ca184c57e4c8228056.tar.bz2
scala-6e7b32649b041a001fdb61ca184c57e4c8228056.zip
Merge pull request #4373 from retronym/topic/indylambda-permutations-2
SI-8359 Adjust parameter order of accessor method in Delambdafy
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/t8359-closelim-crash.flags1
-rw-r--r--test/files/pos/t8359-closelim-crash.scala23
2 files changed, 24 insertions, 0 deletions
diff --git a/test/files/pos/t8359-closelim-crash.flags b/test/files/pos/t8359-closelim-crash.flags
new file mode 100644
index 0000000000..49d036a887
--- /dev/null
+++ b/test/files/pos/t8359-closelim-crash.flags
@@ -0,0 +1 @@
+-optimize
diff --git a/test/files/pos/t8359-closelim-crash.scala b/test/files/pos/t8359-closelim-crash.scala
new file mode 100644
index 0000000000..1413694d10
--- /dev/null
+++ b/test/files/pos/t8359-closelim-crash.scala
@@ -0,0 +1,23 @@
+package test
+
+// This is a minimization of code that crashed the compiler during bootstrapping
+// in the first iteration of https://github.com/scala/scala/pull/4373, the PR
+// that adjusted the order of free and declared params in LambdaLift.
+
+// Was:
+// java.lang.AssertionError: assertion failed:
+// Record Record(<$anon: Function1>,Map(value a$1 -> Deref(LocalVar(value b)))) does not contain a field value b$1
+// at scala.tools.nsc.Global.assert(Global.scala:262)
+// at scala.tools.nsc.backend.icode.analysis.CopyPropagation$copyLattice$State.getFieldNonRecordValue(CopyPropagation.scala:113)
+// at scala.tools.nsc.backend.icode.analysis.CopyPropagation$copyLattice$State.getFieldNonRecordValue(CopyPropagation.scala:122)
+// at scala.tools.nsc.backend.opt.ClosureElimination$ClosureElim$$anonfun$analyzeMethod$1$$anonfun$apply$2.replaceFieldAccess$1(ClosureElimination.scala:124)
+class Typer {
+ def bar(a: Boolean, b: Boolean): Unit = {
+ @inline
+ def baz(): Unit = {
+ ((_: Any) => (Typer.this, a, b)).apply("")
+ }
+ ((_: Any) => baz()).apply("")
+ }
+}
+