1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Add ValueType checking functions for types that have the same NormalType

This commit is contained in:
Silvan Mosberger 2020-12-12 02:15:11 +01:00
parent 22ead43a0b
commit bf98903967
No known key found for this signature in database
GPG key ID: E8F1E9EAD284E17D
8 changed files with 40 additions and 26 deletions

View file

@ -126,6 +126,20 @@ struct Value
inline void setExternal() { type = tExternal; };
inline void setFloat() { type = tFloat; };
// Functions needed to distinguish the type
// These should be removed eventually, by putting the functionality that's
// needed by callers into methods of this type
// normalType() == nThunk
inline bool isThunk() const { return type == tThunk; };
inline bool isApp() const { return type == tApp; };
inline bool isBlackhole() const { return type == tBlackhole; };
// normalType() == nFunction
inline bool isLambda() const { return type == tLambda; };
inline bool isPrimOp() const { return type == tPrimOp; };
inline bool isPrimOpApp() const { return type == tPrimOpApp; };
union
{
NixInt integer;