summaryrefslogblamecommitdiff
path: root/test/files/pos/spec-t3497.scala
blob: 6cc0e24f89c28b47d68e7a7347c165a88ac3d200 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                         
    


            
abstract class A[T, @specialized U] {
    def score(state: T): U
}

object B extends A[ Array[Byte], Int ] {
  def score(state: Array[Byte]): Int = {
    var index = 0
    while (index < state.length) { // (index < 2) leads to the #2755 NullPointerException
      if (state(index) == 0) {
        return -1
      }
    }
    
    return 0
  }
}