RFR: 8202178(type.getKind() for var is None instead of Error)

Srinivas Dama srinivas.dama at oracle.com
Thu May 24 19:57:18 UTC 2018


Hi Maurizio,

Thank you for the comments.
Here is the latest webrev: http://cr.openjdk.java.net/~sdama/8202178/webrev.01/ 

I have verified with different 'var' initializations as you suggested for instance 
variables in accordance with bug.

It seems changes in Check are not required for the case of instance variables
having 'NONE' types as this will be addressed in MemeberEnter only.
So I have removed Check changes and modified test.

If it turns out to handle any other case other than instance variables,I will file
a separate bug and add new test case.

Please review.

Regards,
Srinivas
----- Original Message -----
From: maurizio.cimadamore at oracle.com
To: srinivas.dama at oracle.com, compiler-dev at openjdk.java.net
Sent: Wednesday, 23 May, 2018 2:17:09 AM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi
Subject: Re: RFR: 8202178(type.getKind() for var is None instead of Error)

Hi,
the changes in MemberEnter look good (as they replicate more or less 
what happens in Attr.visitVarDef). That said, I'm not sure about the 
changes in Check - the routine you modified is only called when a 
variable has an initializer, which is not the case at least in the test 
you attached.

Also, since you are there, I suggest to enhance the test to try:

* 'var' field with regular initializer

* 'var' field with constant (e.g. string "Hello") initializer

* 'var' field with no initializer (as now)

Each of the above case goes through a slightly different code path.

Maurizio


On 22/05/18 18:32, Srinivas Dama wrote:
> Hi,
>
> Please review http://cr.openjdk.java.net/~sdama/8202178/webrev.00/ for
> https://bugs.openjdk.java.net/browse/JDK-8202178
>
> Regards,
> Srinivas



More information about the compiler-dev mailing list