Is target-typing for conditional expressions in cast context supported?
bitter_fox
bitterfoxc at gmail.com
Tue Feb 21 02:57:46 PST 2012
Oh, I see it hasn't been implemented now.
I wait for the specification and the implementation.
Thank you.
Regards,
bitter_fox
2012/2/20 Maurizio Cimadamore <maurizio.cimadamore at oracle.com>
> Hi,
> target-typing in cast context is still an open issue in both the compiler
> and the language spec.
>
> Maurizio
>
>
> On 20/02/12 10:03, bitter_fox wrote:
>
>> Hi,
>> when I compile this program, the compiler which is the newest binary
>> snapshot says it is illegal.
>>
>> class Main
>> {
>> interface SAM
>> {
>> void invoke();
>> }
>>
>> public static void main(String[] args)
>> {
>> Object obj = (SAM)(true ? () -> {} : () -> {}); // Illegal
>> }
>> }
>>
>> I know that there is a compiler option to enable target-typing in method
>> invocation context:
>> -XDcomplexinference
>> But it does not work to this situation.
>> Is there another compiler option to enable target-typing in cast context?
>>
>> Regards,
>> bitter_fox
>>
>>
>
More information about the lambda-dev
mailing list