summaryrefslogtreecommitdiff
path: root/test/files/pos/bug3234.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-06-16 22:14:52 +0000
committerPaul Phillips <paulp@improving.org>2010-06-16 22:14:52 +0000
commitb9fb76d09d0a6e63bfb6f332079ab7d05f1233ca (patch)
treeb98217ca683aef4e378b1f189400984bf72bdf08 /test/files/pos/bug3234.scala
parentf750b08d9e8121c32cd433ee167cbc95705429ed (diff)
downloadscala-b9fb76d09d0a6e63bfb6f332079ab7d05f1233ca.tar.gz
scala-b9fb76d09d0a6e63bfb6f332079ab7d05f1233ca.tar.bz2
scala-b9fb76d09d0a6e63bfb6f332079ab7d05f1233ca.zip
The inliner now looks harder for method impleme...
The inliner now looks harder for method implementations. In addition to the receiver, it will find those in directly mixed in traits and in superclasses. It still won't find those in traits mixed only into superclasses, as that didn't come quite so easily. Closes #3234 but I'll be opening up another ticket. Review by dragos.
Diffstat (limited to 'test/files/pos/bug3234.scala')
-rw-r--r--test/files/pos/bug3234.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/pos/bug3234.scala b/test/files/pos/bug3234.scala
new file mode 100644
index 0000000000..1553f1fa05
--- /dev/null
+++ b/test/files/pos/bug3234.scala
@@ -0,0 +1,19 @@
+trait Trait1 {
+ // need more work before this one works
+ // @inline
+ def foo2(n: Int) = n*n
+}
+
+trait Trait2 {
+ @inline def foo3(n: Int) = 1
+}
+
+class Base extends Trait1 {
+ @inline def foo(n: Int) = n
+}
+
+object Test extends Base with Trait2 {
+ def main(args: Array[String]) = {
+ println(foo(42) + foo2(11) + foo3(2))
+ }
+} \ No newline at end of file