The code is obvious, and I fail to see what's wrong with it.
object TestX extends App {
val l= List[String]( "a","b","c" )
val n= l.size
def f( i:Int )= l[(i+1)%n ]
}
Compiler output (Scala 2.9.2):
fsc -deprecation -d bin src/xxx.scala
src/xxx.scala:11: error: identifier expected but integer literal found.
def f( i:Int )= l[(i+1)%n]
^