[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-compiler-dev
Subject:    RE: [EXTERNAL] Re: Possible compiler bug? Code compiles on 8 but not 11
From:       David Grieve <David.Grieve () microsoft ! com>
Date:       2020-01-31 20:13:01
Message-ID: BN8PR21MB128121242C63C6C00FE77D569B070 () BN8PR21MB1281 ! namprd21 ! prod ! outlook ! com
[Download RAW message or body]

Understood. Like I said, casting solves the problem, so I am not looking for support. I thought you might be interested in a case where compilation breaks on 11. I will try to distill the code to something that can be put inline. 

> -----Original Message-----
> From: compiler-dev <compiler-dev-bounces@openjdk.java.net> On Behalf Of
> Alex Buckley
> Sent: Friday, January 31, 2020 1:59 PM
> To: compiler-dev@openjdk.java.net
> Subject: [EXTERNAL] Re: Possible compiler bug? Code compiles on 8 but not
> 11
> 
> Hi David,
> 
> This is a question of whether javac is conforming to the JLS, and if so,
> whether the JLS is correct. It's best in such cases to quote the smallest
> possible code sample in inline text. Oracle's javac team is not looking to
> reproduce issues in the manner of a support organization, but rather to
> understand as precisely as possible what's going on in the type system.
> 
> Alex
> 
> On 1/31/2020 10:36 AM, David Grieve wrote:
> > I have some code that compiles on 8 but not on 11. With 11 (11.0.5, to be
> exact), the compiler gives an error:
> >
> >> Factory.java
> >> Error:(9, 25) java: incompatible types: java.lang.Object cannot be
> converted to Manager<java.lang.String>
> >
> > This can be fixed with an explicit cast. But it seems to me that the cast
> should not be needed.
> >
> > I'm hoping to get an answer for why this compiles cleanly on 8, but not 11.
> >
> > I have uploaded a small sample that reproduces to
> https://nam06.safelinks.protection.outlook.com/?url=http:%2F%2Fcr.openjd
> k.java.net%2F~dgrieve%2Fjavac-
> bug.zip&amp;data=02%7C01%7Cdavid.grieve%40microsoft.com%7C5b62d5e
> 00aa04bfc305308d7a6806653%7C72f988bf86f141af91ab2d7cd011db47%7C1
> %7C0%7C637160944402111070&amp;sdata=kB7DeYrkwvE7VZkYRg%2B0osPP
> ucvJZdGaKvyiux1Wbp0%3D&amp;reserved=0
> >

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic