zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2k stars 592 forks source link

Undeprecate Using Enumerators With/Without their Enum's Scopes. #2282

Closed InsertCreativityHere closed 3 weeks ago

InsertCreativityHere commented 3 weeks ago

Currently, when you reference an enumerator in Slice, it's optional whether or not you include it's enum's scope:

enum MyEnum { A, B }

const C1 = MyEnum::A;
const C2 = B;

Both of the above are legal Slice statements, but currently, the compiler will issue a warning for the 2nd one (omitting the enum). It's kind of like C-style vs C++-style enums. in C, the enumerators are dumped in the enclosing scope, in C++, the enum class is a new scope. Note that if the compiler cannot unambiguously determine what you're referring to (when using the 2nd unscoped syntax) we will issue an error, so there's no concern there.

The only places where it's legal to reference an enumerator in Slice is:


Since this feature is not broken, documented, and possibly in use by people, this PR simply undeprecates it. There is no other change in behavior.