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:
parent
22ead43a0b
commit
bf98903967
8 changed files with 40 additions and 26 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue