Example #1
0
 public IType GetFunctionPointerType(SRM.MethodSignature <IType> signature)
 {
     if (signature.Header.IsInstance)
     {
         // pointers to member functions are not supported even in C# 9
         return(compilation.FindType(KnownTypeCode.IntPtr));
     }
     return(FunctionPointerType.FromSignature(signature, module));
 }
Example #2
0
        public (SignatureHeader, FunctionPointerType) DecodeMethodSignature(StandaloneSignatureHandle handle, GenericContext genericContext)
        {
            var standaloneSignature = metadata.GetStandaloneSignature(handle);

            if (standaloneSignature.GetKind() != StandaloneSignatureKind.Method)
            {
                throw new BadImageFormatException("Expected Method signature");
            }
            var sig = standaloneSignature.DecodeMethodSignature(TypeProvider, genericContext);
            var fpt = FunctionPointerType.FromSignature(sig, this);

            return(sig.Header, (FunctionPointerType)IntroduceTupleTypes(fpt));
        }
Example #3
0
 public virtual IType VisitFunctionPointerType(FunctionPointerType type)
 {
     return(type.VisitChildren(this));
 }