-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
7
-
x86
-
linux, windows_7
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The javac compiler can't handle the usage of diamond notation <> with ?: conditional operator.
The following code:
List<String> list = false ? null : new ArrayList<>();
doesn't compile with error:
incompatible types
required: List<String>
found: ArrayList<Object>
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
The javac compiler can't handle the usage of diamond notation <> with ?: conditional operator.
The following code:
List<String> list = false ? null : new ArrayList<>();
doesn't compile with error:
incompatible types
required: List<String>
found: ArrayList<Object>
REPRODUCIBILITY :
This bug can be reproduced always.
- duplicates
-
JDK-7189915 Conditional assignment in combination with diamond operator gives complier error
- Closed
- relates to
-
JDK-7115044 Umbrella: Add support for lambda expressions
- Resolved