Fix crash

This commit is contained in:
Hackerpilot 2016-08-15 03:46:33 -07:00
parent b46842d637
commit 10374061ea
3 changed files with 21 additions and 1 deletions

View File

@ -804,7 +804,12 @@ DSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
if (symbols.length == 0 || symbols[0].type is null || symbols[0].type is symbols[0])
return [];
else if (symbols[0].type.kind == CompletionKind.functionName)
symbols = [symbols[0].type.type];
{
if (symbols[0].type.type is null)
symbols = [];
else
symbols = [symbols[0].type.type];
}
else
symbols = [symbols[0].type];
}

11
tests/tc040/file.d Normal file
View File

@ -0,0 +1,11 @@
T[] dbGet(T)(string sql)
{
}
void main()
{
foreach (res; dbGet!int("select * from table"))
{
aa[res.];
}
}

4
tests/tc040/run.sh Executable file
View File

@ -0,0 +1,4 @@
set -e
set -u
../../bin/dcd-client $1 file.d -c105