summaryrefslogtreecommitdiff
path: root/test/files/run/t7015.check
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-02-20 15:31:32 -0800
committerJames Iry <jamesiry@gmail.com>2013-02-21 09:02:37 -0800
commit1b6661b8b586637ba5d54510c7bda1144acab23b (patch)
tree8abb70e9fd764f4dd4aff09dd12c015cdd723fdf /test/files/run/t7015.check
parent70956e560a11996e1d801d59b312dfe9d56b7a74 (diff)
downloadscala-1b6661b8b586637ba5d54510c7bda1144acab23b.tar.gz
scala-1b6661b8b586637ba5d54510c7bda1144acab23b.tar.bz2
scala-1b6661b8b586637ba5d54510c7bda1144acab23b.zip
SI-7015 Removes redundant aconst_null; pop; aconst_null creation
In an effort to adapt methods and field accesses of type Null to other types, we were always emitting aconst_null pop aconst_null The problem is we were doing that even when the JVM was in a position to know it had null value, e.g. when the user had written a null constant. This commit fixes that and includes a test to show that the resulting byte code still works even without repeating ourselves and/or repeating ourselves. This commit also makes the scala.runtim.Null$ constructor private. It was a sealed abstract class which prevented subclassing in Scala, but it didn't prevent subclassing in Java. A private constructor takes care of that hole so now the only value of type Null$ should be null. Along the way I found some other questionable things in adapt and I've added TODO's and issue https://issues.scala-lang.org/browse/SI-7159 to track.
Diffstat (limited to 'test/files/run/t7015.check')
-rw-r--r--test/files/run/t7015.check11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/t7015.check b/test/files/run/t7015.check
new file mode 100644
index 0000000000..7651fe06b0
--- /dev/null
+++ b/test/files/run/t7015.check
@@ -0,0 +1,11 @@
+Method returns Null type: null
+Method takes non Null type: null
+call through method null
+call through bridge null
+fetch field: null
+fetch field on companion: null
+fetch local: null
+fetch array element: null
+method that takes object: null
+method that takes anyref: null
+method that takes any: null