We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include
extend
When pattern matching inside a class method an include Dry::Monads[:maybe] is needed, the extend Dry::Monads[:maybe] is not enough and causes a crash.
include Dry::Monads[:maybe]
extend Dry::Monads[:maybe]
Simple script:
class Foo include Dry::Monads[:maybe] extend Dry::Monads[:maybe] def self.foo case Some(4) in Some(a) puts a in None() puts 'none' end end end
Removing any include or extend will cause this script to fail:
Some(4)
NoMethodError: undefined method
Some(a)
NameError: uninitialized constant Foo::Some
Ideally I'd like to only have to extend Dry::Monads[:maybe] for a class method, not both.
Dry::Monads[:maybe]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When pattern matching inside a class method an
include Dry::Monads[:maybe]
is needed, theextend Dry::Monads[:maybe]
is not enough and causes a crash.To Reproduce
Simple script:
Removing any
include
orextend
will cause this script to fail:extend
causesSome(4)
to raiseNoMethodError: undefined method
Some' for Foo:Class` (makes sense)extend
causesSome(a)
to raiseNameError: uninitialized constant Foo::Some
(?)Expected behavior
Ideally I'd like to only have to extend
Dry::Monads[:maybe]
for a class method, not both.My environment
The text was updated successfully, but these errors were encountered: