mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #10678 from tamasvajk/kotlin-type-param-modifiers
Kotlin: Extract type parameter modifiers (`reified`, `in`, `out`)
This commit is contained in:
@@ -137,7 +137,7 @@ abstract class BoundedType extends RefType, @boundedtype {
|
||||
* For example, `T` is a type parameter in
|
||||
* `class X<T> { }` and in `<T> void m() { }`.
|
||||
*/
|
||||
class TypeVariable extends BoundedType, @typevariable {
|
||||
class TypeVariable extends BoundedType, Modifiable, @typevariable {
|
||||
/** Gets the generic type that is parameterized by this type parameter, if any. */
|
||||
GenericType getGenericType() { typeVars(this, _, _, _, result) }
|
||||
|
||||
|
||||
@@ -96,4 +96,13 @@ abstract class Modifiable extends Element {
|
||||
|
||||
/** Holds if this element has a `lateinit` modifier. */
|
||||
predicate isLateinit() { this.hasModifier("lateinit") }
|
||||
|
||||
/** Holds if this element has a `reified` modifier. */
|
||||
predicate isReified() { this.hasModifier("reified") }
|
||||
|
||||
/** Holds if this element has an `in` modifier. */
|
||||
predicate isIn() { this.hasModifier("in") }
|
||||
|
||||
/** Holds if this element has an `out` modifier. */
|
||||
predicate isOut() { this.hasModifier("out") }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user