[JSR308] Receiver on field initializers
gafter at google.com
Sun May 11 22:00:04 EDT 2008
On Sun, May 11, 2008 at 5:02 PM, Mahmood Ali <mahmood at mit.edu> wrote:
> No subtype rules are specified for constructors invocation (unlike other
>> method invocations).
> Is there any reason that constructors are treated differently than method
> invocations? In my particular case the constructors need to be treated just
> like method calls.
> The previous sentence has a typo, my fault. The sentence (along with the
> sentence preceding it) should have been:
> The framework currently checks arguments passed to the constructor for
> valid subtyping. No subtype rules are specified for constructor invocation
> *receiver* (unlike other method invocations).
> We simply could not find a common rule to restrict constructor invocation
> based on the constructor receiver, unlike method invocation. Within method
> invocation, the receiver is a formal parameter.
In a constructor, I would expect the receiver type to be the (possibly
annotated) type given in the class creation expression.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the JSR308