Esempio n. 1
0
        public static IConvertableFrontendType <IVerifiableType> MapType(IVerifiableType verifiableType)
        {
            if (verifiableType is INumberType)
            {
                return(PrimitiveTypes.CreateNumberType());
            }
            if (verifiableType is IBooleanType)
            {
                return(PrimitiveTypes.CreateBooleanType());
            }
            if (verifiableType is IStringType)
            {
                return(PrimitiveTypes.CreateStringType());
            }
            if (verifiableType is IBlockType)
            {
                return(PrimitiveTypes.CreateBlockType());
            }
            if (verifiableType is IEmptyType)
            {
                return(PrimitiveTypes.CreateEmptyType());
            }
            if (verifiableType is IAnyType)
            {
                return(PrimitiveTypes.CreateAnyType());
            }
            if (verifiableType is IMethodType method)
            {
                return(PrimitiveTypes.CreateMethodType(
                           MapType(method.InputType),
                           MapType(method.OutputType)
                           ));
            }
            if (verifiableType is IImplementationType implementation)
            {
                return(PrimitiveTypes.CreateImplementationType(
                           MapType(implementation.ContextType),
                           MapType(implementation.InputType),
                           MapType(implementation.OutputType)
                           ));
            }

            throw new NotImplementedException();
        }
Esempio n. 2
0
 public override IIsPossibly <IFrontendType> Returns()
 {
     return(Possibly.Is <IFrontendType>(PrimitiveTypes.CreateBlockType()));
 }