[WIP] Add quantifier to polymorphic types
This commit is contained in:
9
type.h
9
type.h
@@ -368,6 +368,7 @@ private:
|
||||
class PolyType : public Type {
|
||||
public:
|
||||
Variability GetVariability() const;
|
||||
int GetQuant() const;
|
||||
|
||||
bool IsBoolType() const;
|
||||
bool IsFloatType() const;
|
||||
@@ -1064,6 +1065,14 @@ CastType(const Type *type) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template <> inline const PolyType *
|
||||
CastType(const Type *type) {
|
||||
if (type != NULL && type->typeId == POLY_TYPE)
|
||||
return (const PolyType *)type;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template <> inline const EnumType *
|
||||
CastType(const Type *type) {
|
||||
if (type != NULL && type->typeId == ENUM_TYPE)
|
||||
|
||||
Reference in New Issue
Block a user