-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathKotlinType.qll
More file actions
37 lines (29 loc) · 975 Bytes
/
KotlinType.qll
File metadata and controls
37 lines (29 loc) · 975 Bytes
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
/**
* Provides classes and predicates for working with Kotlin types.
*/
overlay[local?]
module;
import java
class KotlinType extends Element, @kt_type { }
class KotlinNullableType extends KotlinType, @kt_nullable_type {
override string toString() {
exists(RefType javaType |
kt_nullable_types(this, javaType) and
result = "Kotlin nullable " + javaType.toString()
)
}
override string getAPrimaryQlClass() { result = "KotlinNullableType" }
}
class KotlinNotnullType extends KotlinType, @kt_notnull_type {
override string toString() {
exists(RefType javaType |
kt_notnull_types(this, javaType) and
result = "Kotlin not-null " + javaType.toString()
)
}
override string getAPrimaryQlClass() { result = "KotlinNotnullType" }
}
class KotlinTypeAlias extends Element, @kt_type_alias {
override string getAPrimaryQlClass() { result = "KotlinTypeAlias" }
KotlinType getKotlinType() { kt_type_alias(this, _, result) }
}