[JSR308] Receiver on field initializers

Neal Gafter 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:

> Greetings,
>
> 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...
URL: https://lists.csail.mit.edu/pipermail/jsr308/attachments/20080511/e1049a73/attachment.htm 


More information about the JSR308 mailing list