blob: 8eb69cb9bb7557f18b890190dfbe57a21e6afd84 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package hello
import scala.annotation.tailrec
class Enclosing {
class SomeData(val x: Int)
def localDef(): Unit = {
def foo(data: SomeData): Int = data.x
@tailrec
def test(i: Int, data: SomeData): Unit = {
if (i != 0) {
println(foo(data))
test(i - 1, data)
}
}
test(3, new SomeData(42))
}
}
object world extends App {
println("hello dotty!")
new Enclosing().localDef()
}
|