|
Scala Library
|
|
scala/annotation/switch.scala]
final
class
switch
extends StaticAnnotation
An annotation to be applied to a match expression. If present,
the compiler will verify that the match has been compiled to a
tableswitch or
lookupswitch, and issue an error if it
instead compiles into a series of conditional expressions.
Example:
def fetchToken() {
(ch: @switch) match {
case ' ' | '\t' | CR | LF | FF =>
nextChar()
fetchToken()
case 'A' /*..'Z'*/ | '$' | '_' | 'a' /*..'z'*/ =>
putChar(ch)
nextChar()
getIdentRest()
case ',' =>
nextChar(); token = COMMA
// more cases
}
}| Methods inherited from AnyRef | |
| getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
| Methods inherited from Any | |
| ==, !=, isInstanceOf, asInstanceOf |
|
Scala Library
|
|