Esempio n. 1
0
  public static void bindOverride(
      CallableMemberDescriptor fromCurrent, CallableMemberDescriptor fromSupertype) {
    fromCurrent.addOverriddenDescriptor(fromSupertype);

    for (ValueParameterDescriptor parameterFromCurrent : fromCurrent.getValueParameters()) {
      assert parameterFromCurrent.getIndex() < fromSupertype.getValueParameters().size()
          : "An override relation between functions implies that they have the same number of value parameters";
      ValueParameterDescriptor parameterFromSupertype =
          fromSupertype.getValueParameters().get(parameterFromCurrent.getIndex());
      parameterFromCurrent.addOverriddenDescriptor(parameterFromSupertype);
    }
  }
Esempio n. 2
0
 static List<KotlinType> compiledValueParameters(CallableDescriptor callableDescriptor) {
   ReceiverParameterDescriptor receiverParameter =
       callableDescriptor.getExtensionReceiverParameter();
   List<KotlinType> parameters = new ArrayList<KotlinType>();
   if (receiverParameter != null) {
     parameters.add(receiverParameter.getType());
   }
   for (ValueParameterDescriptor valueParameterDescriptor :
       callableDescriptor.getValueParameters()) {
     parameters.add(valueParameterDescriptor.getType());
   }
   return parameters;
 }