jshell has trouble to register some records in the environment

Jan Lahoda jan.lahoda at oracle.com
Thu Jan 9 12:30:32 UTC 2020


Hi,

I've filled:
https://bugs.openjdk.java.net/browse/JDK-8236715

and sent:
https://mail.openjdk.java.net/pipermail/kulla-dev/2020-January/002467.html

Thanks for the report,
     Jan

On 07. 01. 20 2:59, Michel Trudeau wrote:
> moving the conversation to kulla-dev
> 
> On Dec 26, 2019, at 9:45 AM, forax at univ-mlv.fr wrote:
> 
>> De: "Ali Ebrahimi" <ali.ebrahimi1781 at gmail.com>
>> À: "Remi Forax" <forax at univ-mlv.fr>
>> Cc: "amber-dev" <amber-dev at openjdk.java.net>
>> Envoyé: Jeudi 26 Décembre 2019 17:48:35
>> Objet: Re: jshell has trouble to register some records in the environment
> 
>> hi Remi,
>> Is there typo in
>> ...> return Math.hypot( with , height); // width
> 
> Thanks Ali !
> Anyway, jshell should report this as an error. Is there an empty catch block somewhere ??
> 
> Rémi
> 
>> On Thu, Dec 26, 2019 at 3:54 PM Remi Forax < [ mailto:forax at univ-mlv.fr |
>> forax at univ-mlv.fr ] > wrote:
> 
>>> Hi all,
>>> converting some materials for undergraduates, i have uncover a weird bug.
> 
>>> This snippet of code doesn't work in jshell
>>> (jshell --enable-preview).
> 
>>> I get
> 
>>> jshell> record Rectangle(int width, int height) {
>>> ...> double diagonal() {
>>> ...> return Math.hypot(with, height);
>>> ...> }
>>> ...> }
>>> ...> var rectangle2 = new Rectangle(4, 3);
>>> ...> System.out.println(rectangle2.diagonal());
>>> | Error:
>>> | cannot find symbol
>>> | symbol: class Rectangle
>>> | var rectangle2 = new Rectangle(4, 3);
>>> | ^-------^
> 
>>> So the class/record Rectangle doesn't seem to be registered ?
>>> Changing it to
> 
>>> record Rectangle(int width, int height) {
>>> double diagonal() {
>>> return 5;
>>> }
>>> }
>>> var rectangle2 = new Rectangle(4, 3);
>>> System.out.println(rectangle2.diagonal());
> 
>>> do work ??
> 
>>> Rémi
> 
>> --
> 
>> Best Regards,
>> Ali Ebrahimi
> 


More information about the kulla-dev mailing list