Details
-
Bug
-
Resolution: Fixed
-
P5
-
8
Description
For completeness, 18.2 prescribes a "false" result for the reduction of certain constraints that should never be encountered by a compiler. These all involve non-proper types appearing in certain parts of a lambda's or method ref's target type.
In these cases, a clarifying comment would be useful.
---
18.2.1
If the lambda expression is implicitly typed and one or more of the function type's parameter types is not a proper type, the constraint reduces to false.
***This condition never arises in practice, due to the handling of implicitly-typed lambda expressions in 18.5.1 and the substitution applied to the target type in 18.5.2.***
...
If one or more of the function type's parameter types is not a proper type, the constraint reduces to false.
***This condition never arises in practice, due to the handling of inexact method references in 18.5.1 and the substitution applied to the target type in 18.5.2.***
---
18.2.5
Otherwise, if the lambda expression is implicitly typed, and one or more of the function type's parameter types is not a proper type, the constraint reduces to false.
Otherwise, if the function type's return type is neither void nor a proper type, the constraint reduces to false.
***The previous two conditions never arise in practice, due to the substitution applied to the target type in 18.5.2.***
In these cases, a clarifying comment would be useful.
---
18.2.1
If the lambda expression is implicitly typed and one or more of the function type's parameter types is not a proper type, the constraint reduces to false.
***This condition never arises in practice, due to the handling of implicitly-typed lambda expressions in 18.5.1 and the substitution applied to the target type in 18.5.2.***
...
If one or more of the function type's parameter types is not a proper type, the constraint reduces to false.
***This condition never arises in practice, due to the handling of inexact method references in 18.5.1 and the substitution applied to the target type in 18.5.2.***
---
18.2.5
Otherwise, if the lambda expression is implicitly typed, and one or more of the function type's parameter types is not a proper type, the constraint reduces to false.
Otherwise, if the function type's return type is neither void nor a proper type, the constraint reduces to false.
***The previous two conditions never arise in practice, due to the substitution applied to the target type in 18.5.2.***