Allow invoke-convention on dynamic expressions

This commit is contained in:
Andrey Breslav
2014-11-27 09:37:40 +03:00
parent 53bbf20b0d
commit b7dd63465b
4 changed files with 20 additions and 6 deletions
@@ -124,8 +124,7 @@ public class TaskPrioritizer {
) {
ProgressIndicatorProvider.checkCanceled();
ReceiverValue dispatchReceiver = c.context.call.getDispatchReceiver();
boolean resolveInvoke = dispatchReceiver.exists() && !TypesPackage.isDynamic(dispatchReceiver.getType());
boolean resolveInvoke = c.context.call.getDispatchReceiver().exists();
if (resolveInvoke) {
addCandidatesForInvoke(receiver, c);
return;
@@ -61,6 +61,12 @@ object DynamicCallableDescriptors {
override fun getFunctions(name: Name): Collection<FunctionDescriptor> {
if (isAugmentedAssignmentConvention(name)) return listOf()
if (call.getCallType() == Call.CallType.INVOKE
&& call.getValueArgumentList() == null && call.getFunctionLiteralArguments().isEmpty()) {
// this means that we are looking for "imaginary" invokes,
// e.g. in `+d` we are looking for property "plus" with member "invoke"
return listOf()
}
return listOf(createDynamicFunction(owner, name, call))
}