File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
lib/dry/initializer/plugins Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def type
1414 end
1515
1616 def dry_type?
17- type . class . ancestors . map ( & :name ) . include? "Dry::Types::Builder"
17+ type . respond_to? :call
1818 end
1919
2020 def plain_type?
@@ -24,6 +24,9 @@ def plain_type?
2424 def module_type_constraint
2525 return unless plain_type?
2626
27+ warn "[DEPRECATION] support for ruby modules as type constraint" \
28+ " is deprecated. Use dry-types instead."
29+
2730 "fail #{ TypeError } .new(:#{ name } , #{ type } , @#{ name } )" \
2831 " unless @#{ name } == Dry::Initializer::UNDEFINED ||" \
2932 " #{ type } === @#{ name } "
@@ -44,6 +47,9 @@ def dry_type_constraint
4447 end
4548
4649 def object_type_constraint
50+ warn "[DEPRECATION] support for case equality (===) as type constraint" \
51+ " is deprecated. Use dry-types instead."
52+
4753 ivar = :"@#{ name } "
4854 constraint = type
4955
You can’t perform that action at this time.
0 commit comments