Beispiel #1
0
        internal static KotlinEffect FromProtobuf(Effect ef, JvmNameResolver resolver)
        {
            if (ef is null)
            {
                return(null);
            }

            return(new KotlinEffect {
                EffectType = (KotlinEffectType)ef.effect_type,
                EffectConstructorArguments = ef.EffectConstructorArguments?.Select(vp => KotlinExpression.FromProtobuf(vp, resolver)).ToList(),
                ConclusionOfConditionalEffect = KotlinExpression.FromProtobuf(ef.ConclusionOfConditionalEffect, resolver),
                Kind = (KotlinInvocationKind)ef.Kind
            });
        }
Beispiel #2
0
        internal static KotlinExpression FromProtobuf(Expression exp, JvmNameResolver resolver)
        {
            if (exp is null)
            {
                return(null);
            }

            return(new KotlinExpression {
                Flags = exp.Flags,
                ValueParameterReference = exp.ValueParameterReference,
                ConstantValue = (KotlinConstantValue)exp.constant_value,
                IsInstanceType = KotlinType.FromProtobuf(exp.IsInstanceType, resolver),
                IsInstanceTypeId = exp.IsInstanceTypeId,
                AndArguments = exp.AndArguments?.Select(tp => KotlinExpression.FromProtobuf(tp, resolver)).ToList(),
                OrArguments = exp.OrArguments?.Select(vp => KotlinExpression.FromProtobuf(vp, resolver)).ToList()
            });
        }