diff --git a/src/spicy/runtime-support.h b/src/spicy/runtime-support.h index 3abcb6a7d6..9ac7ecfcfc 100644 --- a/src/spicy/runtime-support.h +++ b/src/spicy/runtime-support.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -882,7 +883,7 @@ inline ValPtr to_val(const T& t, TypePtr target) { auto num_fields = rtype->NumFields(); - t.__visit([&](const auto& name, const auto& val) { + t.__visit([&](std::string_view name, const auto& val) { if ( idx >= num_fields ) throw TypeMismatch(hilti::rt::fmt("no matching record field for field '%s'", name));