mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
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:
4
java/ql/lib/change-notes/2022-07-12-errortype.md
Normal file
4
java/ql/lib/change-notes/2022-07-12-errortype.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Added an `ErrorType` class. An instance of this class will be used if an extractor is unable to extract a type, or if an up/downgrade script is unable to provide a type.
|
||||
@@ -332,6 +332,14 @@ modifiers(
|
||||
string nodeName: string ref
|
||||
);
|
||||
|
||||
/**
|
||||
* An errortype is used when the extractor is unable to extract a type
|
||||
* correctly for some reason.
|
||||
*/
|
||||
error_type(
|
||||
unique int id: @errortype
|
||||
);
|
||||
|
||||
classes(
|
||||
unique int id: @class,
|
||||
string nodeName: string ref,
|
||||
@@ -1012,13 +1020,13 @@ javadocText(
|
||||
@classorinterfaceorpackage = @classorinterface | @package;
|
||||
@classorinterfaceorcallable = @classorinterface | @callable;
|
||||
@boundedtype = @typevariable | @wildcard;
|
||||
@reftype = @classorinterface | @array | @boundedtype;
|
||||
@reftype = @classorinterface | @array | @boundedtype | @errortype;
|
||||
@classorarray = @class | @array;
|
||||
@type = @primitive | @reftype;
|
||||
@callable = @method | @constructor;
|
||||
|
||||
/** A program element that has a name. */
|
||||
@element = @package | @modifier | @annotation |
|
||||
@element = @package | @modifier | @annotation | @errortype |
|
||||
@locatableElement;
|
||||
|
||||
@locatableElement = @file | @primitive | @class | @interface | @method | @constructor | @param | @exception | @field |
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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>"
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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() }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1236
java/ql/lib/upgrades/cf58c7d9b1fa1eae9cdc20ce8f157c140ac0c3de/semmlecode.dbscheme
Executable file
1236
java/ql/lib/upgrades/cf58c7d9b1fa1eae9cdc20ce8f157c140ac0c3de/semmlecode.dbscheme
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Add errortype
|
||||
compatibility: full
|
||||
Reference in New Issue
Block a user