Details
-
Bug
-
Resolution: Fixed
-
P5
-
8
Description
The following rule and clarification is used to determine whether a conditional is a boolean conditional:
"A method invocation expression (§15.12) for which the chosen most specific method (§15.12.2.5) has return type boolean or Boolean."
"Note that, for a generic method, this is the type before instantiating the method's type arguments."
The note about generic methods is missing from the same rule for numeric conditionals:
"A method invocation expression (§15.12) for which the chosen most specific method (§15.12.2.5) has a return type that is convertible to a numeric type."
Granted, the clarification would be redundant, but as it stands, the lack of a clarifying note makes it seem like maybe the numeric case is supposed to be treated differently.
"A method invocation expression (§15.12) for which the chosen most specific method (§15.12.2.5) has return type boolean or Boolean."
"Note that, for a generic method, this is the type before instantiating the method's type arguments."
The note about generic methods is missing from the same rule for numeric conditionals:
"A method invocation expression (§15.12) for which the chosen most specific method (§15.12.2.5) has a return type that is convertible to a numeric type."
Granted, the clarification would be redundant, but as it stands, the lack of a clarifying note makes it seem like maybe the numeric case is supposed to be treated differently.