Merge pull request #9806 from igfoo/igfoo/useType

Kotlin: Extract an ErrorType if we fail to correctly extract a type
This commit is contained in:
Ian Lynagh
2022-07-12 13:45:04 +01:00
committed by GitHub
9 changed files with 4670 additions and 2100 deletions

View File

@@ -47,6 +47,8 @@ predicate hasName(Element e, string name) {
kt_type_alias(e, name, _)
or
ktProperties(e, name)
or
e instanceof ErrorType and name = "<CodeQL error type>"
}
/**

View File

@@ -666,6 +666,14 @@ class RefType extends Type, Annotatable, Modifiable, @reftype {
}
}
/**
* An `ErrorType` is generated when CodeQL is unable to correctly
* extract a type.
*/
class ErrorType extends RefType, @errortype {
override string getAPrimaryQlClass() { result = "ErrorType" }
}
/** A type that is the same as its source declaration. */
class SrcRefType extends RefType {
SrcRefType() { this.isSourceDeclaration() }