Merge pull request #9201 from Marcono1234/marcono1234/NumericType-type-qll

Java: Move `NumericType` to `Type.qll`
This commit is contained in:
Anders Schack-Mulligen
2022-05-18 10:31:40 +02:00
committed by GitHub
2 changed files with 12 additions and 12 deletions

View File

@@ -144,18 +144,6 @@ class NumberType extends RefType {
NumberType() { exists(TypeNumber number | hasDescendant(number, this)) }
}
/** A numeric type, including both primitive and boxed types. */
class NumericType extends Type {
NumericType() {
exists(string name |
name = this.(PrimitiveType).getName() or
name = this.(BoxedType).getPrimitiveType().getName()
|
name.regexpMatch("byte|short|int|long|double|float")
)
}
}
/** An immutable type. */
class ImmutableType extends Type {
ImmutableType() {

View File

@@ -1246,6 +1246,18 @@ class CharacterType extends Type {
}
}
/** A numeric type, including both primitive and boxed types. */
class NumericType extends Type {
NumericType() {
exists(string name |
name = this.(PrimitiveType).getName() or
name = this.(BoxedType).getPrimitiveType().getName()
|
name.regexpMatch("byte|short|int|long|double|float")
)
}
}
/** A numeric or character type, which may be either a primitive or a boxed type. */
class NumericOrCharType extends Type {
NumericOrCharType() {