Closed InsertCreativityHere closed 1 week ago
I've been told to merge this as-is for now. I'll look into improving the string generation in the future.
For what it's worth, this is a general problem with our code-gen. Not specific to this PR. So it's probably better to fix it for all the places at once.
This PR updates the deprecation logic of
slice2cpp
. Currently, on main, we ignore all[deprecated]
metadata except when applied to an interface, or an operation. And deprecating an interface is just a shorthand for deprecating all it's operations...If an operation is deprecated, we will generate
[[deprecated]]
on it's mapped functions, both in the generatedPrx
proxy class and the servant skeleton.This PR implements the first half of #2085 by removing the
[[deprecated]]
from the dispatch side code.But it also expands what
[[deprecated]]
can be applied to, since it's very limited in C++ (compared to Java and C# where it's supported on most things). Now we support[deprecated]
on:[[deprecated]]
on the mapped enum)[[deprecated]]
on the mapped const)[[deprecated]]
on the mapped struct/exception class)[[deprecated]]
, one on the class, and one on theusing XXXPtr
we generate for the class).[[deprecated]]
on the mapped field)The logic for proxy code is unchanged. And the behavior for deprecating an interface has also changed. Previously it meant:
just deprecate all it's operations
, now deprecating an interface causes the compiler to deprecate the mapped proxy class.