diff --git a/lib/dry/types/hash.rb b/lib/dry/types/hash.rb index 1342ad5e..7606237e 100644 --- a/lib/dry/types/hash.rb +++ b/lib/dry/types/hash.rb @@ -121,13 +121,8 @@ def build_keys(type_map) # @api private def resolve_type(type) case type - when ::Class - if type < Type - type - else - Types[type] - end - when ::String then Types[type] + when Type then type + when ::Class, ::String then Types[type] else type end end diff --git a/spec/dry/types/schema_spec.rb b/spec/dry/types/schema_spec.rb index 0f7a6327..19018a9c 100644 --- a/spec/dry/types/schema_spec.rb +++ b/spec/dry/types/schema_spec.rb @@ -293,7 +293,7 @@ def self.to_ary it 'uses type even if it is a class with a registered name' do bool = Class.new do - include(Dry::Types::Type) + extend Dry::Types::Type def self.meta {}