UiaElement copy ctor and assignment operator do subtly different things
mlalic opened this issue · 1 comments
mlalic commented
In the following snippet...
void Fn(UiaElement original)
{
UiaElement newElement = original;
}
The newElement
will end up aliasing the same remote object. More precisely, it'll refer to the same operand register as original
(on the lowest-level of Remote Ops bytecode).
Meanwhile, in the following...
void Fn(UiaElement original)
{
UiaElement newElement{ nullptr };
newElement = original;
}
A Set
instruction is emitted in the bytecode that assigns the original element to a new operand register in the bytecode.
This means that two things that typically should work the same (the copy ctor and assignment operator) end up with subtly different behavior.
This issue tracks making a decision about this -- whether to try to make any changes to make these two operations work the same way or whether to document this rough edge as expected/by design.