removing ufcs completion for non constrained templates
This commit is contained in:
parent
e65e86a744
commit
1e4475c773
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue