diff --git a/libs/interpreter/source/eval.cpp b/libs/interpreter/source/eval.cpp index f8fe084..a515b42 100644 --- a/libs/interpreter/source/eval.cpp +++ b/libs/interpreter/source/eval.cpp @@ -472,6 +472,18 @@ namespace pslang::interpreter return std::visit([&](auto const & type){ return cast_impl(value, type); }, type); } + template + value cast_impl(primitive_value_base const &, type::array_type const &) + { + throw std::runtime_error("Cannot cast anything to array type"); + } + + template + value cast_impl(primitive_value_base const &, type::function_type const &) + { + throw std::runtime_error("Cannot cast anything to function type"); + } + template value cast_impl(primitive_value_base const & value, type::type const & type) {