Included array matching
This commit is contained in:
parent
95e484a202
commit
8326bdb428
|
@ -290,6 +290,13 @@ private bool matchesWithTypeOfPointer(const(DSymbol)* incomingSymbol, const(DSym
|
|||
|
||||
}
|
||||
|
||||
private bool matchesWithTypeOfArray(const(DSymbol)* incomingSymbol, const(DSymbol)* cursorSymbolType) {
|
||||
return incomingSymbol.functionParameters.front.type.qualifier == SymbolQualifier.array
|
||||
&& cursorSymbolType.qualifier == SymbolQualifier.array
|
||||
&& incomingSymbol.functionParameters.front.type.type is cursorSymbolType.type;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Params:
|
||||
* incomingSymbol = the function symbol to check if it is valid for UFCS with `beforeDotType`.
|
||||
|
@ -313,6 +320,7 @@ bool isCallableWithArg(const(DSymbol)* incomingSymbol, const(DSymbol)* beforeDot
|
|||
{
|
||||
return beforeDotType is incomingSymbol.functionParameters.front.type
|
||||
|| isNonConstrainedTemplate(incomingSymbol)
|
||||
|| matchesWithTypeOfArray(incomingSymbol, beforeDotType)
|
||||
|| matchesWithTypeOfPointer(incomingSymbol, beforeDotType)
|
||||
|| willImplicitBeUpcasted(beforeDotType, incomingSymbol)
|
||||
|| matchAliasThis(beforeDotType, incomingSymbol, recursionDepth);
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
identifiers
|
||||
alignof k
|
||||
arrayStuff F
|
||||
doArray F
|
||||
dup k
|
||||
idup k
|
||||
init k
|
||||
length k
|
||||
mangleof k
|
||||
ptr k
|
||||
sizeof k
|
||||
stringof k
|
|
@ -0,0 +1,5 @@
|
|||
void arrayStuff(int[] x) { }
|
||||
void doArray(int[] x, int[] y)
|
||||
{
|
||||
y.
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
../../bin/dcd-client $1 -c65 file.d > actual_array_test.txt
|
||||
diff actual_array_test.txt expected_array_test.txt
|
Loading…
Reference in New Issue