@@ -14,7 +14,7 @@ std::optional<nix::Value> nixt::getField(nix::EvalState &State, nix::Value &V,
1414 return std::nullopt ;
1515
1616 nix::Symbol SFiled = State.symbols .create (Field);
17- if (auto *It = V.attrs ->find (SFiled); It != V.attrs ->end ())
17+ if (auto *It = V.attrs () ->find (SFiled); It != V.attrs () ->end ())
1818 return *It->value ;
1919
2020 return std::nullopt ;
@@ -86,11 +86,11 @@ nix::Value &nixt::selectAttr(nix::EvalState &State, nix::Value &V,
8686 State.forceValue (V, nix::noPos);
8787
8888 if (V.type () != nix::ValueType::nAttrs)
89- throw nix::TypeError (" value is not an attrset" );
89+ throw nix::TypeError (State, " value is not an attrset" );
9090
91- assert (V.attrs && " nix must allocate non-null attrs!" );
92- auto *Nested = V.attrs ->find (Attr);
93- if (Nested == V.attrs ->end ())
91+ assert (V.attrs () && " nix must allocate non-null attrs!" );
92+ auto *Nested = V.attrs () ->find (Attr);
93+ if (Nested == V.attrs () ->end ())
9494 throw nix::AttrPathNotFound (" attrname " + State.symbols [Attr] +
9595 " not found in attrset" );
9696
@@ -145,11 +145,12 @@ nix::Value getSubOptions(nix::EvalState &State, nix::Value &Type) {
145145 nix::Value &GetSubOptions =
146146 selectAttr (State, Type, State.symbols .create (" getSubOptions" ));
147147
148- nix::Value EmptyList;
149- EmptyList.mkList (0 );
148+ auto list = State.buildList (0 );
149+ auto EmptyList = State.allocValue ();
150+ EmptyList->mkList (list);
150151 // Invoke "GetSubOptions"
151152 nix::Value VResult;
152- State.callFunction (GetSubOptions, EmptyList, VResult, nix::noPos);
153+ State.callFunction (GetSubOptions, * EmptyList, VResult, nix::noPos);
153154 return VResult;
154155}
155156
0 commit comments