From eb08c12099517ed761a3d2bc8268984596071bde Mon Sep 17 00:00:00 2001 From: Folkert Date: Sun, 23 Jan 2022 21:45:06 +0100 Subject: [PATCH] format `as` aliases with parens --- compiler/fmt/src/annotation.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/fmt/src/annotation.rs b/compiler/fmt/src/annotation.rs index b36b4d56b6..08b7dc68a4 100644 --- a/compiler/fmt/src/annotation.rs +++ b/compiler/fmt/src/annotation.rs @@ -263,8 +263,9 @@ impl<'a> Formattable for TypeAnnotation<'a> { } As(lhs, _spaces, AliasHeader { name, vars }) => { - // TODO use spaces? - lhs.value.format(buf, indent); + // TODO use _spaces? + lhs.value + .format_with_options(buf, Parens::InFunctionType, Newlines::No, indent); buf.spaces(1); buf.push_str("as"); buf.spaces(1);