ice icon indicating copy to clipboard operation
ice copied to clipboard

"deprecate" metadata

Open bernardnormier opened this issue 7 years ago • 0 comments

Affects Ice 3.7

The Slice deprecate metadata applies to various Slice definitions and currently affects only the generated code. If you use a Slice definition marked "deprecate" in another Slice definition, you don't get a warning when compiling your Slice file. For example, Slice-compiling the following Slice file does not emit any warning:

module DepTest
{
    ["deprecate"] interface A
    {
        void op();
        A* get();
    }

    ["deprecate"] struct S
    {
        int x;
    }

    interface B
    {
        A* get();
        void op(S s);
    }
}

We should: (a) consider renaming "deprecate" to "deprecated" to match the corresponding C++ attribute and Java annotation

(b) emit a warning when Slice-compiling a definition that uses a deprecated type, except when this definition is itself marked deprecated.

For example:

    ["deprecate"] struct S
    {
        int x;
    }

    interface B
    {
        void op(S s);
    }

should emit a warning unless op is itself marked deprecated.

(operations on a deprecated interface can use this deprecated type without being marked themselves deprecated)

bernardnormier avatar Sep 22 '18 20:09 bernardnormier