> > Generics is involved, and generics is not capable of representing variable > arity, so, if the generics say there is a return type.... there's a return > type. > Void and void have basically zero relation. That's all there is to it, > really. Returning no thing is just as impossible as returning 2 things. >
I can see it both ways, although I really do lean towards it being something that should've been fixed when generics were added. For instance, one can use reflection to get the return type of method returning void, which is bound to Class[?}, suggesting that we ARE indeed dealing with a class instance. The difference seems to be that when the CLR got generics support, the void keyword was made to act as an alias for the struct System.Void (much like string is an alias for System.String etc.) and so a value type is ALWAYS returned (though I suppose a clever JIT compiler will just optimize this away). I wonder if this "unification" Ricky Clarkson is referring to, would go the same way - seems like a nice way to solve the problem. -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/hn_oduMkEZ8J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
