mirror of
https://github.com/dlang-community/DCD.git
synced 2025-04-26 21:29:58 +03:00
Fix issue 353: single template arg not recognized.
This commit is contained in:
parent
9e64dcf8e2
commit
6c04abc3f1
6 changed files with 31 additions and 6 deletions
|
@ -1196,12 +1196,6 @@ T getExpression(T)(T beforeTokens)
|
|||
break expressionLoop;
|
||||
mixin (TYPE_IDENT_AND_LITERAL_CASES);
|
||||
mixin (EXPRESSION_LOOP_BREAK);
|
||||
if (i > 1 && beforeTokens[i - 1] == tok!"!"
|
||||
&& beforeTokens[i - 2] == tok!"identifier")
|
||||
{
|
||||
sliceEnd -= 2;
|
||||
i--;
|
||||
}
|
||||
break;
|
||||
case tok!".":
|
||||
break;
|
||||
|
|
1
tests/tc049/expected1.txt
Normal file
1
tests/tc049/expected1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
stdin 26
|
1
tests/tc049/expected2.txt
Normal file
1
tests/tc049/expected2.txt
Normal file
|
@ -0,0 +1 @@
|
|||
stdin 26
|
1
tests/tc049/expected3.txt
Normal file
1
tests/tc049/expected3.txt
Normal file
|
@ -0,0 +1 @@
|
|||
stdin 143
|
17
tests/tc049/file.d
Normal file
17
tests/tc049/file.d
Normal file
|
@ -0,0 +1,17 @@
|
|||
alias T(alias X) = X;
|
||||
int foo;
|
||||
alias baz = T!(foo); // works
|
||||
alias bar = T!foo; // doesn't work
|
||||
|
||||
final class ABC
|
||||
{
|
||||
static @property bool mybool()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
while(!ABC.mybool) {}
|
||||
}
|
11
tests/tc049/run.sh
Executable file
11
tests/tc049/run.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
../../bin/dcd-client $1 file.d -l -c76 > actual1.txt
|
||||
diff actual1.txt expected1.txt
|
||||
|
||||
../../bin/dcd-client $1 file.d -l -c47 > actual2.txt
|
||||
diff actual2.txt expected2.txt
|
||||
|
||||
../../bin/dcd-client $1 file.d -l -c218 > actual3.txt
|
||||
diff actual3.txt expected3.txt
|
Loading…
Add table
Add a link
Reference in a new issue