mirror of
https://github.com/NixOS/nix
synced 2025-06-26 07:31:15 +02:00
Introduce NormalType for the normal type of a Value
This will be useful to abstract over the ValueType implementation details Make use of it already to replace the showType(ValueType) function
This commit is contained in:
parent
9c143c411b
commit
fa307875e9
5 changed files with 68 additions and 34 deletions
|
@ -513,7 +513,7 @@ std::string AttrCursor::getString()
|
|||
auto & v = forceValue();
|
||||
|
||||
if (v.type != tString && v.type != tPath)
|
||||
throw TypeError("'%s' is not a string but %s", getAttrPathStr(), showType(v.type));
|
||||
throw TypeError("'%s' is not a string but %s", getAttrPathStr(), showType(v.normalType()));
|
||||
|
||||
return v.type == tString ? v.string.s : v.path;
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ string_t AttrCursor::getStringWithContext()
|
|||
else if (v.type == tPath)
|
||||
return {v.path, {}};
|
||||
else
|
||||
throw TypeError("'%s' is not a string but %s", getAttrPathStr(), showType(v.type));
|
||||
throw TypeError("'%s' is not a string but %s", getAttrPathStr(), showType(v.normalType()));
|
||||
}
|
||||
|
||||
bool AttrCursor::getBool()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue