Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by
whitespace.
Patch by Martin Probst, thank you.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236382
91177308-0d34-0410-b5e6-
96231b3b80d8
Line.First->isOneOf(Keywords.kw_import, tok::kw_export))
return false;
if (Left.is(TT_TemplateCloser) &&
- !Right.isOneOf(tok::l_brace, tok::comma, tok::l_square,
+ !Right.isOneOf(tok::equal, tok::l_brace, tok::comma, tok::l_square,
Keywords.kw_implements, Keywords.kw_extends))
// Type assertions ('<type>expr') are not followed by whitespace. Other
// locations that should have whitespace following are identified by the
verifyFormat("foo<Y>(a);");
verifyFormat("var x: X<Y>[];");
verifyFormat("class C extends D<E> implements F<G>, H<I> {}");
+ verifyFormat("function f(a: List<any> = null) {\n}");
+ verifyFormat("function f(): List<any> {\n}");
}
TEST_F(FormatTestJS, OptionalTypes) {