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); }
/// <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)); }
/// <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))); }
/// <inheritdoc /> public object VisitFunctionPointerType(FunctionPointerTypeSignature signature) => throw new NotSupportedException("Function pointer type signatures are not supported in type name building.");