Why partial methods can only have an empty return type?

What is the reason / logic / obstacle that partial methods can only have an invalid return type?

thank

+5
source share
3 answers

Partial methods are designed to be excluded if you have not provided them with an implementation. The compiler actually removes calls with partial methods that are not implemented.

It also emphasizes why they cannot return anything: if you relied on the return value without implementing a partial method, then what? You would have something uninitialized even though the code clearly shows the purpose.

+9
source

.

, - , . , .

, - "" , .

.

+2

. void, . , , .

0

All Articles