I'm trying to use nested numeric optimization, where the condition of the inner function is a variable we optimize over the in the outer function. It seems like that Mathematica can't substitute the variable in the condition properly. Here is a very simple example of this
NMaxValue[{NMaxValue[{x, x <= y}, x], y <= 10}, y]
Is this intentional? Is there an angle I'm not seeing, why there is a problem with the above? Or is it a bug/missing feature? How can I circumvent this?