mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix issue 497: insert space before function/delegate in function type that returns template instantiated with parenless value argument
This commit is contained in:
parent
d92a6799ac
commit
e4f2f20720
4 changed files with 18 additions and 1 deletions
|
@ -211,7 +211,9 @@ private:
|
|||
{
|
||||
immutable t = tokens[index].type;
|
||||
if (t == tok!"identifier" || isStringLiteral(t)
|
||||
|| isNumberLiteral(t) || t == tok!"characterLiteral")
|
||||
|| isNumberLiteral(t) || t == tok!"characterLiteral"
|
||||
// a!"b" function()
|
||||
|| t == tok!"function" || t == tok!"delegate")
|
||||
write(" ");
|
||||
}
|
||||
}
|
||||
|
|
5
tests/allman/issue0497.d.ref
Normal file
5
tests/allman/issue0497.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
|||
alias f1 = S function();
|
||||
alias f2 = S!"foo" function();
|
||||
alias f3 = S!5 function();
|
||||
alias f4 = S!S function();
|
||||
alias f5 = S!(S) function();
|
5
tests/issue0497.d
Normal file
5
tests/issue0497.d
Normal file
|
@ -0,0 +1,5 @@
|
|||
alias f1 = S function();
|
||||
alias f2 = S!"foo" function();
|
||||
alias f3 = S!5 function();
|
||||
alias f4 = S!S function();
|
||||
alias f5 = S!(S) function();
|
5
tests/otbs/issue0497.d.ref
Normal file
5
tests/otbs/issue0497.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
|||
alias f1 = S function();
|
||||
alias f2 = S!"foo" function();
|
||||
alias f3 = S!5 function();
|
||||
alias f4 = S!S function();
|
||||
alias f5 = S!(S) function();
|
Loading…
Add table
Add a link
Reference in a new issue