Let us suppose that we have a Partial Class called Foo, like this:
Partial Public Class Foo
Partial Private Sub Bar(lorem As String)
End Function
Private Sub Bar(lorem As String)
'Do something
End Function
End Class
This is a Class called Foo and has a Partial method. My question is: why is it illegal to use Partial Functions like this:
Partial Public Class Foo
Partial Private Function Bar(lorem As String) As Boolean
End Sub
Private Function Bar(lorem As String) As Boolean
Return lorem.StartsWith("A")
End Sub
End Class
?
If return values were allowed, the compiler would not be able to know how to handle return values. Imagine if the partial method weren't actually implemented. After all, a partial method doesn't have to have an implementation. It's an opportunity to.
Where would the return value come from in that case? What if the caller of the partial method tried to use the return value but it was never implemented?