tonerdo / pose

Replace any .NET method (including static and non-virtual) with a delegate
MIT License
1.07k stars 75 forks source link

ShimHelper.ValidateReplacementMethodSignature has ambiguous and vague output that does not help with debugging #75

Open duaneking opened 1 year ago

duaneking commented 1 year ago

Why don't any of the error messages tell me the types they are talking about?

Every single error message in this library should be telling me exactly what's wrong ; It has the data. It just doesn't use it or give it to the user when it explodes for random, often unknown and hard to debug reasons.

ShimHelper.ValidateReplacementMethodSignature() is telling me it has mismatched return types; No idea how or why, because the error output does not tell me. It could, Its literally looking at the type data and it could tell me this easily. But it doesn't, and that's a HUGE bug.

Simply replacing the line on https://github.com/tonerdo/pose/blob/master/src/Pose/Helpers/ShimHelper.cs#L74 with one that includes the type fullnames would be best.