Skip to content

Commit 418d593

Browse files
committed
Swift: Replace NumericOrCharType with a more basic NumericType, and rename classes for consistency with other static languages.
1 parent d0eb167 commit 418d593

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

swift/ql/lib/codeql/swift/elements/type/NumericOrCharType.qll

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class CharacterType extends StructType {
1919
/**
2020
* An integer-like type. For example, `Int`, `Int16`, `Uint16`, etc.
2121
*/
22-
class IntegerType extends Type {
23-
IntegerType() {
22+
class IntegralType extends Type {
23+
IntegralType() {
2424
this.getName() =
2525
["Int", "Int8", "Int16", "Int32", "Int64", "UInt", "UInt8", "UInt16", "UInt32", "UInt64"]
2626
or
@@ -29,18 +29,16 @@ class IntegerType extends Type {
2929
}
3030

3131
/** The `Bool` type. */
32-
class BooleanType extends Type {
33-
BooleanType() { this.getName() = "Bool" }
32+
class BoolType extends Type {
33+
BoolType() { this.getName() = "Bool" }
3434
}
3535

3636
/**
37-
* A numeric-like type. This includes the types `Character`, `Bool`, and all
38-
* the integer-like types.
37+
* A numeric type. This includes the integer and floating point types.
3938
*/
40-
class NumericOrCharType extends Type {
41-
NumericOrCharType() {
42-
this instanceof CharacterType or
43-
this instanceof IntegerType or
44-
this instanceof BooleanType
39+
class NumericType extends Type {
40+
NumericType() {
41+
this instanceof IntegralType or
42+
this instanceof FloatingPointType
4543
}
4644
}

0 commit comments

Comments
 (0)