diff options
author | Silvan Mosberger <contact@infinisil.com> | 2020-12-12 02:15:11 +0100 |
---|---|---|
committer | Silvan Mosberger <contact@infinisil.com> | 2020-12-12 03:31:50 +0100 |
commit | bf9890396731a2bbe4f04a49684dee463d818906 (patch) | |
tree | 171d646c0540828a294346e887c214ba44b5472c /src/nix/repl.cc | |
parent | 22ead43a0b8f94f5a4fb64cff14bf6a2a35d671c (diff) |
Add ValueType checking functions for types that have the same NormalType
Diffstat (limited to 'src/nix/repl.cc')
-rw-r--r-- | src/nix/repl.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 56184efb9..047e2dc59 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -450,7 +450,7 @@ bool NixRepl::processLine(string line) PathSet context; auto filename = state->coerceToString(noPos, v, context); pos.file = state->symbols.create(filename); - } else if (v.type == tLambda) { + } else if (v.isLambda()) { pos = v.lambda.fun->pos; } else { // assume it's a derivation @@ -760,13 +760,13 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m break; case nFunction: - if (v.type == tLambda) { + if (v.isLambda()) { std::ostringstream s; s << v.lambda.fun->pos; str << ANSI_BLUE "«lambda @ " << filterANSIEscapes(s.str()) << "»" ANSI_NORMAL; - } else if (v.type == tPrimOp) { + } else if (v.isPrimOp()) { str << ANSI_MAGENTA "«primop»" ANSI_NORMAL; - } else if (v.type == tPrimOpApp) { + } else if (v.isPrimOpApp()) { str << ANSI_BLUE "«primop-app»" ANSI_NORMAL; } else { abort(); |