removing ufcs completion for non constrained templates

This commit is contained in:
davu 2023-03-16 23:18:00 +01:00
parent e65e86a744
commit 1e4475c773
2 changed files with 1 additions and 7 deletions

View File

@ -710,8 +710,7 @@ unittest
// position of variable life
size_t cursorPos = 82;
auto pair = generateAutocompleteTreesProd(ufcsTemplateExampleCode, randomDFilename, cursorPos, cache);
assert(pair.ufcsSymbols.length > 0);
assert(pair.ufcsSymbols[0].name == "increment");
assert(pair.ufcsSymbols.length == 0);
}

View File

@ -279,10 +279,6 @@ private bool matchAliasThis(const(DSymbol)* beforeDotType, const(DSymbol)* incom
return isCallableWithArg(incomingSymbol, beforeDotType.aliasThisSymbols.front.type, false, recursionDepth);
}
bool isNonConstrainedTemplate(const(DSymbol)* incomingSymbol){
return incomingSymbol.functionParameters.front.type !is null && incomingSymbol.functionParameters.front.type.kind is CompletionKind.typeTmpParam;
}
/**
* Params:
* incomingSymbol = the function symbol to check if it is valid for UFCS with `beforeDotType`.
@ -305,7 +301,6 @@ bool isCallableWithArg(const(DSymbol)* incomingSymbol, const(DSymbol)* beforeDot
if (incomingSymbol.kind is CompletionKind.functionName && !incomingSymbol.functionParameters.empty && incomingSymbol.functionParameters.front.type)
{
return beforeDotType is incomingSymbol.functionParameters.front.type
|| isNonConstrainedTemplate(incomingSymbol)
|| willImplicitBeUpcasted(beforeDotType, incomingSymbol)
|| matchAliasThis(beforeDotType, incomingSymbol, recursionDepth);