mirror of
https://github.com/github/codeql.git
synced 2026-05-25 08:37:20 +02:00
KE2: Populate Kotlin type nullability and alias information
This commit is contained in:
@@ -478,12 +478,12 @@ kt_nullable_types(
|
||||
)
|
||||
|
||||
/**
|
||||
* `id` is the Kotlin type that is the alias called `name` of `kttypeid`.
|
||||
* That is, it has been defined by `typealias name = kttypeid`.
|
||||
* `id` is the Kotlin type that is the alias called `classid` of `kttypeid`.
|
||||
* That is, it has been defined by `typealias classid = kttypeid`.
|
||||
*/
|
||||
kt_type_alias(
|
||||
kt_type_aliases(
|
||||
unique int id: @kt_type_alias,
|
||||
string name: string ref,
|
||||
int classid: @reftype ref,
|
||||
int kttypeid: @kt_type ref
|
||||
)
|
||||
|
||||
|
||||
@@ -42,8 +42,10 @@ predicate hasName(Element e, string name) {
|
||||
or
|
||||
modifiers(e, name)
|
||||
or
|
||||
kt_type_alias(e, name, _)
|
||||
or
|
||||
// TODO: An alias declaration might have a name, but the type that
|
||||
// uses it doesn't
|
||||
// or
|
||||
// kt_type_alias(e, name, _)
|
||||
ktProperties(e, name)
|
||||
or
|
||||
e instanceof ErrorType and name = "<CodeQL error type>"
|
||||
|
||||
@@ -32,7 +32,9 @@ class KotlinTypeAlias extends KotlinType, @kt_type_alias {
|
||||
result = "{" + this.getKotlinType().toString() + "}" + this.getName()
|
||||
}
|
||||
|
||||
override string getName() { kt_type_alias(this, result, _) }
|
||||
override string getName() { result = this.getAliasClass().getName() }
|
||||
|
||||
KotlinType getKotlinType() { kt_type_alias(this, _, result) }
|
||||
Class getAliasClass() { kt_type_aliases(this, result, _) }
|
||||
|
||||
KotlinType getKotlinType() { kt_type_aliases(this, _, result) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user