From f2c1736b94c96a6e6950801ee053b30e872985a4 Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Thu, 26 Jul 2012 20:35:21 +0200 Subject: SI-6142: warn @inline-methods ending up not inlined (rightfully or not) --- test/files/neg/t3234.check | 2 ++ test/files/neg/t3234.flags | 1 + test/files/neg/t3234.scala | 19 +++++++++++++++++++ test/files/pos/t3234.flags | 1 - test/files/pos/t3234.scala | 19 ------------------- 5 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 test/files/neg/t3234.check create mode 100644 test/files/neg/t3234.flags create mode 100644 test/files/neg/t3234.scala delete mode 100644 test/files/pos/t3234.flags delete mode 100644 test/files/pos/t3234.scala (limited to 'test/files') diff --git a/test/files/neg/t3234.check b/test/files/neg/t3234.check new file mode 100644 index 0000000000..477b021e5e --- /dev/null +++ b/test/files/neg/t3234.check @@ -0,0 +1,2 @@ +error: there were 1 inliner warnings; re-run with -Yinline-warnings for details +one error found diff --git a/test/files/neg/t3234.flags b/test/files/neg/t3234.flags new file mode 100644 index 0000000000..c9cefdc4b9 --- /dev/null +++ b/test/files/neg/t3234.flags @@ -0,0 +1 @@ +-Yinline -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t3234.scala b/test/files/neg/t3234.scala new file mode 100644 index 0000000000..443d0467f0 --- /dev/null +++ b/test/files/neg/t3234.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 diff --git a/test/files/pos/t3234.flags b/test/files/pos/t3234.flags deleted file mode 100644 index c9cefdc4b9..0000000000 --- a/test/files/pos/t3234.flags +++ /dev/null @@ -1 +0,0 @@ --Yinline -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t3234.scala b/test/files/pos/t3234.scala deleted file mode 100644 index 443d0467f0..0000000000 --- a/test/files/pos/t3234.scala +++ /dev/null @@ -1,19 +0,0 @@ -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 -- cgit v1.2.3