-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathcomments.kt
More file actions
93 lines (81 loc) · 1.42 KB
/
comments.kt
File metadata and controls
93 lines (81 loc) · 1.42 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/** Kdoc owned by CompilationUnit */
package foo.bar
/**
* A group of *members*.
*
* This class has no useful logic; it's just a documentation example.
*
* @property name the name of this group.
* @constructor Creates an empty group.
*/
class Group(val name: String) {
/**
* Members of this group.
*/
private val members = mutableListOf<Any>()
/**
* Adds a [member] to this group.
* @return the new size of the group.
*/
fun add(member: Int): Int {
// A line comment
return 42
}
/*
A block comment
*/
}
enum class Severity(val sev: Int) {
Low(1),
/** Medium is in the middle */
Medium(2),
/** This is high */
High(3)
}
fun fn1() {
/**
* A variable.
*/
val a = 1
}
/**
* A type alias comment
*/
typealias MyType = Group
class InitBlock {
/**
* An init block comment
*/
init { }
}
open class X {
/**
* A prop comment
*/
val prop: Int
/**
* An accessor comment
*/
get() = 5
val l: Lazy<Int> = lazy(
/**
* An anonymous function comment
*/
fun(): Int {
return 5
})
fun fn() {
/**
* A local function comment
*/
fun localFn() {}
}
}
class XX {
fun f() = object :
/**
* An anonymous object comment
*/
X() {
}
}