I have noticed the following:
MyEnum = Types::Strict::Symbol.enum(:a, :b) MyEnum[:a] === :a # =>true
Don’t you think that it is breaking the type safety that it should provide? I mean, I think it should guarantee that you are not going to use a wrong
MyEnum in any case, but if you can use plain symbols in place you are overpassing it. For example:
def test(x) case x when MyEnum[:a] "a" when MyEnum[:b] "b" else "I shoould have raised" end test MyEnum[:c] # => Dry::Types::ConstraintError ... test :c # => "I should have raised"