Exemple #1
0
        public void MatchFunctionPointerTypeSignatures()
        {
            var expected = new FunctionPointerTypeSignature(
                new MethodSignature(new[] { new ParameterSignature(CreateTypeSig1()) }, CreateTypeSig2()));
            var match = new FunctionPointerTypeSignature(
                new MethodSignature(new[] { new ParameterSignature(CreateTypeSig1()) }, CreateTypeSig2()));
            var fail1 = new FunctionPointerTypeSignature(
                new MethodSignature(new[] { new ParameterSignature(CreateTypeSig2()) }, CreateTypeSig2()));

            VerifyMatching(expected, match, fail1);
        }
Exemple #2
0
        /// <summary>
        /// Determines whether two types are considered equal according to their signature.
        /// </summary>
        /// <param name="signature1">The first type to compare.</param>
        /// <param name="signature2">The second type to compare.</param>
        /// <returns><c>True</c> if the types are considered equal, <c>False</c> otherwise.</returns>
        public bool Equals(FunctionPointerTypeSignature signature1, FunctionPointerTypeSignature signature2)
        {
            if (signature1 == null && signature2 == null)
            {
                return(true);
            }
            if (signature1 == null || signature2 == null)
            {
                return(false);
            }

            return(Equals((CallingConventionSignature)signature1.Signature, signature2.Signature));
        }
Exemple #3
0
        /// <summary>
        /// Determines whether two types are considered equal according to their signature.
        /// </summary>
        /// <param name="signature1">The first type to compare.</param>
        /// <param name="signature2">The second type to compare.</param>
        /// <returns><c>True</c> if the types are considered equal, <c>False</c> otherwise.</returns>
        public bool MatchTypes(FunctionPointerTypeSignature signature1, FunctionPointerTypeSignature signature2)
        {
            if (signature1 == null && signature2 == null)
            {
                return(true);
            }
            if (signature1 == null || signature2 == null)
            {
                return(false);
            }

            return(MatchMemberSignatures(signature1.Signature, signature2.Signature));
        }
 private FunctionPointerTypeSignature ImportFunctionPointerTypeSignature(
     FunctionPointerTypeSignature functionPtrType)
 {
     return(new FunctionPointerTypeSignature(ImportMethodSignature(functionPtrType.Signature)));
 }
Exemple #5
0
 /// <inheritdoc />
 public object VisitFunctionPointerType(FunctionPointerTypeSignature signature) =>
 throw new NotSupportedException("Function pointer type signatures are not supported in type name building.");