-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.kt
46 lines (42 loc) · 910 Bytes
/
Example.kt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
open class Some {
private val f: (Int) -> Int = { a: Int -> a * 2 }
fun foo(): Int {
val test: Int = 12
for (i in 10..42) {
println(
when {
i < test -> -1
i > test -> 1
else -> 0
}
)
}
if (true) {
}
while (true) {
break
}
try {
when (test) {
12 -> println("foo")
else -> println("bar")
}
} catch (e: Exception) {
} finally {
}
return test
}
private fun <T> foo2(): Int where T : List<T> {
return 0
}
fun multilineMethod(
foo: String,
bar: String
) {
foo
.length
}
fun expressionBodyMethod() =
"abc"
}
class AnotherClass<T : Any> : Some()