Fwd: Re: Compilation error with JDK9-ea+138
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Thu Oct 6 17:06:33 UTC 2016
Ok - my test case was correct, but I was missing the -source 1.6. This
is a duplicate of this:
https://bugs.openjdk.java.net/browse/JDK-8160244
Maurizio
On 06/10/16 17:18, Christian Beikov wrote:
> I am using javac through maven-compiler-plugin, but since I posted the
> instructions you can try to invoke that yourself and see with your own
> eyes. I don't know if maven post-processes the compiler messages, but
> according the output, it says javac is used.
>
>
> Regards,
> Christian
>
> Am 06.10.2016 um 18:11 schrieb Jonathan Gibbons:
>>
>> Christian,
>>
>> Since the output does not look like a standard message from javac, I
>> have to ask, what compiler are you using?
>>
>> -- Jon
>>
>>
>> On 10/6/16 8:53 AM, Christian Beikov wrote:
>>> I am having trouble to create a small example that shows the problem
>>> too.
>>> Since the project is open source you can try that yourselves on that
>>> project.
>>>
>>> URL: https://github.com/Blazebit/blaze-persistence.git
>>>
>>> export MAVEN_OPTS="--add-modules=java.se.ee"
>>> mvn -pl jpa-criteria/impl -am clean compile
>>>
>>> Then you will get the error message:
>>> BlazeCriteriaBuilderImpl.java:[997,48] error: incompatible types:
>>> SimpleCase<CAP#1,R> cannot be converted to SimpleCase<C,R>
>>>
>>> Regards,
>>> Christian
>>>
>>> Am 06.10.2016 um 17:30 schrieb Maurizio Cimadamore:
>>>>
>>>> What Jon says. I;ve tried to give this a try using this example:
>>>>
>>>> class Test {
>>>>
>>>> interface Expression<T> { }
>>>>
>>>> interface SimpleCase<A, B> { }
>>>>
>>>> <C, R> SimpleCase<C, R> selectCase(Expression<? extends C>
>>>> expression) {
>>>> return selectCase((Class<R>) null, expression);
>>>> }
>>>>
>>>> <C, R> SimpleCase<C, R> selectCase(Class<R> type, Expression<?
>>>> extends C> expression) {
>>>> return null;
>>>> }
>>>> }
>>>>
>>>>
>>>> But this passes with latest compiler. So I'm probably missing
>>>> something (i.e. some bounds in the type-variable decl for
>>>> Expression or SimpleCase?)
>>>>
>>>> Maurizio
>>>>
>>>>
>>>> On 06/10/16 16:17, Jonathan Gibbons wrote:
>>>>>
>>>>> Christian,
>>>>>
>>>>> As a general rule, it is better if you can post complete but
>>>>> reduced test cases, and post all the messages from the compiler.
>>>>> It is often hard to properly diagnose cases where someone posts
>>>>> some fragment of code and asks what's wrong.
>>>>>
>>>>> -- Jon
>>>>>
>>>>>
>>>>> On 10/6/16 8:08 AM, Christian Beikov wrote:
>>>>>>
>>>>>> I have been directed to this mailing list for this error.
>>>>>>
>>>>>> Is this a known issue?
>>>>>>
>>>>>>
>>>>>>
>>>>>> -------- Weitergeleitete Nachricht --------
>>>>>> Betreff: Re: Compilation error with JDK9-ea+138
>>>>>> Datum: Wed, 05 Oct 2016 10:27:53 -0700
>>>>>> Von: Alex Buckley <alex.buckley at oracle.com>
>>>>>> Organisation: Oracle Corporation
>>>>>> An: jigsaw-dev at openjdk.java.net
>>>>>>
>>>>>>
>>>>>>
>>>>>> This isn't a Jigsaw issue, please mail compiler-dev instead, being sure
>>>>>> to note which JDK 9 build you are compiling with.
>>>>>>
>>>>>> On 10/5/2016 12:55 AM, Christian Beikov wrote:
>>>>>> > The following used to compile just fine on JDKs < 9
>>>>>> >
>>>>>> > @Override
>>>>>> > public <C, R> SimpleCase<C, R> selectCase(Expression<? extends C>
>>>>>> > expression) {
>>>>>> > return selectCase((Class<R>) null, expression);
>>>>>> > }
>>>>>> >
>>>>>> > public <C, R> SimpleCase<C, R> selectCase(Class<R> type,
>>>>>> > Expression<? extends C> expression) {
>>>>>> > return new SimpleCaseExpression<C, R>(this, type, expression);
>>>>>> > }
>>>>>> >
>>>>>> > but now fails with:
>>>>>> > error: incompatible types: SimpleCase<CAP#1,R> cannot be converted
>>>>>> > to SimpleCase<C,R>
>>>>>> >
>>>>>> > The error is in the first selectCase method.
>>>>>> >
>>>>>> > Is that a bug in the compiler?
>>>>>> >
>>>>>> > Regards,
>>>>>> > Christian
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20161006/8bd8bd2a/attachment.html>
More information about the compiler-dev
mailing list