summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2011-12-07 21:18:25 +0100
committerEugene Burmako <xeno.by@gmail.com>2011-12-07 22:38:48 +0100
commita6152b4c2c0a26835e60a8ef209cca87bec8510e (patch)
tree706474dd4f3756a06dd0b14671e626c773c838a3 /test
parent332fec96e31840878bed41dd7b5314b97d8da7c2 (diff)
downloadscala-a6152b4c2c0a26835e60a8ef209cca87bec8510e.tar.gz
scala-a6152b4c2c0a26835e60a8ef209cca87bec8510e.tar.bz2
scala-a6152b4c2c0a26835e60a8ef209cca87bec8510e.zip
Fix reflective toolbox producing invalid bytecode
Wrapper method for AST undergoing a reflective compilation has been incorrectly marked as static. This was off the radars until one day the code being compiled declared a top-level method. During flatten that method got hoisted into the wrapper module, and its invocation got translated into an instance call upon the module. This led to static wrapper method trying to call an instance method, and that blew up the bytecode verifier. More info: https://issues.scala-lang.org/browse/SI-5266. Fixes SI-5266, review by @odersky.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t5239.check2
-rw-r--r--test/files/run/t5266_1.check (renamed from test/pending/run/t5266_1.check)0
-rw-r--r--test/files/run/t5266_1.scala (renamed from test/pending/run/t5266_1.scala)9
-rw-r--r--test/files/run/t5266_2.check (renamed from test/pending/run/t5266_2.check)0
-rw-r--r--test/files/run/t5266_2.scala (renamed from test/pending/run/t5266_2.scala)2
5 files changed, 3 insertions, 10 deletions
diff --git a/test/files/run/t5239.check b/test/files/run/t5239.check
index db5778f95b..40fe6a76e7 100644
--- a/test/files/run/t5239.check
+++ b/test/files/run/t5239.check
@@ -6,7 +6,7 @@ package <empty> {
__wrapper$1.super.this();
()
};
- <static> def wrapper(): Int = 2
+ def wrapper(): Int = 2
}
}
diff --git a/test/pending/run/t5266_1.check b/test/files/run/t5266_1.check
index 3feac16a0b..3feac16a0b 100644
--- a/test/pending/run/t5266_1.check
+++ b/test/files/run/t5266_1.check
diff --git a/test/pending/run/t5266_1.scala b/test/files/run/t5266_1.scala
index 06a81a04ea..18e288e685 100644
--- a/test/pending/run/t5266_1.scala
+++ b/test/files/run/t5266_1.scala
@@ -8,14 +8,7 @@ object Test extends App {
println(x)
};
- val settings = new Settings
- settings.debug.value = true
- settings.Xshowtrees.value = true
- settings.Xprint.value = List("typer")
- settings.printtypes.value = true
- settings.Ytyperdebug.value = true
-
- val reporter = new ConsoleReporter(settings)
+ val reporter = new ConsoleReporter(new Settings)
val toolbox = new ToolBox(reporter)
val ttree = toolbox.typeCheck(code.tree)
val evaluated = toolbox.runExpr(ttree)
diff --git a/test/pending/run/t5266_2.check b/test/files/run/t5266_2.check
index 3feac16a0b..3feac16a0b 100644
--- a/test/pending/run/t5266_2.check
+++ b/test/files/run/t5266_2.check
diff --git a/test/pending/run/t5266_2.scala b/test/files/run/t5266_2.scala
index cd841da021..eb319583f8 100644
--- a/test/pending/run/t5266_2.scala
+++ b/test/files/run/t5266_2.scala
@@ -9,7 +9,7 @@ object Test extends App {
println(y)
};
- val reporter = new ConsoleReporter(settings)
+ val reporter = new ConsoleReporter(new Settings)
val toolbox = new ToolBox(reporter)
val ttree = toolbox.typeCheck(code.tree)
val evaluated = toolbox.runExpr(ttree)