Skip to content

Commit

Permalink
Make Value::type private
Browse files Browse the repository at this point in the history
This is an implementation detail and shouldn't be used. Use normalType()
and the various is<Type> functions instead
  • Loading branch information
infinisil committed Dec 12, 2020
1 parent 71b6f4f commit 527d65d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ RootValue allocRootValue(Value * v)
}


static void printValue(std::ostream & str, std::set<const Value *> & active, const Value & v)
void printValue(std::ostream & str, std::set<const Value *> & active, const Value & v)
{
checkInterrupt();

Expand Down
6 changes: 6 additions & 0 deletions src/libexpr/value.hh
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ std::ostream & operator << (std::ostream & str, const ExternalValueBase & v);

struct Value
{
private:
ValueType type;

friend std::string showType(const Value & v);
friend void printValue(std::ostream & str, std::set<const Value *> & active, const Value & v);

public:

inline void setInt() { type = tInt; };
inline void setBool() { type = tBool; };
inline void setString() { type = tString; };
Expand Down

0 comments on commit 527d65d

Please sign in to comment.