diff options
author | Paul Phillips <paulp@improving.org> | 2010-06-16 22:14:52 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-06-16 22:14:52 +0000 |
commit | b9fb76d09d0a6e63bfb6f332079ab7d05f1233ca (patch) | |
tree | b98217ca683aef4e378b1f189400984bf72bdf08 /test/files | |
parent | f750b08d9e8121c32cd433ee167cbc95705429ed (diff) | |
download | scala-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')
-rw-r--r-- | test/files/pos/bug3234.flags | 1 | ||||
-rw-r--r-- | test/files/pos/bug3234.scala | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/bug3234.flags b/test/files/pos/bug3234.flags new file mode 100644 index 0000000000..c9cefdc4b9 --- /dev/null +++ b/test/files/pos/bug3234.flags @@ -0,0 +1 @@ +-Yinline -Xfatal-warnings
\ No newline at end of file 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 |