I was reading up on partial methods since they will become a lot more important in C#-6 / Visual Studio 2013 update 2 in combination with Windows Universal Projects. While reading the documentation I read this weird limitation on the signature of partial methods:
Partial methods can have ref but not out parameters.
I don't understand the reason for this limitation. Since partial methods are basically a normal method with the signature and implementation in different files, what technical reason would there be to not support out parameters? Or any other reason for this limitation for that matter. Especially since they do support ref parameters which are very similar.
If a partial method is declared but not implemented, it does not get called.
This would mean that any out
parameter does not get assigned, which is not allowed.
This isn't a problem with ref
parameters, as they have to be assigned before they are passed to the method, so they are definitely assigned even if the method is not called.