summaryrefslogtreecommitdiff
path: root/test/files/pos/spec-t3497.scala
blob: ff054aa7de4a59b7ea99b002aee3f19157d8eb0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
  }
}