diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-03-31 14:02:51 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-03-31 16:18:08 +0200 |
commit | bf6398820971fb0133c53a86e6835ee0f549c35b (patch) | |
tree | 6b1f99dcf9118ca611884ea739a2d0b324706d4b /src/library | |
parent | 6372df754ca8943a5fea3455936dbb6c1723d78e (diff) | |
download | scala-bf6398820971fb0133c53a86e6835ee0f549c35b.tar.gz scala-bf6398820971fb0133c53a86e6835ee0f549c35b.tar.bz2 scala-bf6398820971fb0133c53a86e6835ee0f549c35b.zip |
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.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/annotation/switch.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/library/scala/annotation/switch.scala b/src/library/scala/annotation/switch.scala index 23e3923407..00124cf88b 100644 --- a/src/library/scala/annotation/switch.scala +++ b/src/library/scala/annotation/switch.scala @@ -22,6 +22,9 @@ package scala.annotation } }}} * + * Note: for pattern matches with one or two cases, the compiler generates jump instructions. + * Annotating such a match with `@switch` does not issue any warning. + * * @author Paul Phillips * @since 2.8 */ |