From f22cd63a2a780bf86269e9a410e1c60221e5e3a9 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Thu, 18 Dec 2025 16:31:02 +0300 Subject: [PATCH] Print function types simpler when they have only 1 argument --- libs/type/source/print.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/type/source/print.cpp b/libs/type/source/print.cpp index 28eb321..635b326 100644 --- a/libs/type/source/print.cpp +++ b/libs/type/source/print.cpp @@ -80,6 +80,14 @@ namespace pslang::type void print_impl(std::ostream & out, function_type const & type) { + if (type.arguments.size() == 1) + { + print(out, *type.arguments.front()); + out << " -> "; + print(out, *type.result); + return; + } + out << '('; bool first = true; for (auto const & argument : type.arguments)