From bf6398820971fb0133c53a86e6835ee0f549c35b Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 31 Mar 2015 14:02:51 +0200 Subject: SI-8731 don't issue a @switch warning for two-case matches This allows annotating small pattern matches with `@switch` without getting any warnings. There's no reason to warn, the performance of the generated bytecode is good. --- test/files/neg/t8731.check | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test') diff --git a/test/files/neg/t8731.check b/test/files/neg/t8731.check index 2a9af475fc..d47bd55b45 100644 --- a/test/files/neg/t8731.check +++ b/test/files/neg/t8731.check @@ -1,9 +1,6 @@ -t8731.scala:5: warning: matches with two cases or fewer are emitted using if-then-else instead of switch - def f(x: Int) = (x: @annotation.switch) match { - ^ t8731.scala:10: warning: could not emit switch for @switch annotated match def g(x: Int) = (x: @annotation.switch) match { ^ error: No warnings can be incurred under -Xfatal-warnings. -two warnings found +one warning found one error found -- cgit v1.2.3