Alex Fedorov

Results 152 comments of Alex Fedorov

There is one solution: stop using inheritance for code reuse - it only increases coupling and calls more problems. Use composition instead.

There was no so much activity here, and I am reluctant to closing this because @egonSchiele thinks that it is important to spell out contracts explicitly for each method. WDYT?

Actually I like @sebnozzi 's idea about validating inherited methods contracts. WDYT @egonSchiele ?

Well, it will be hard to do if blocks/lambdas are present in contract.. Unless we force not to use lambda/procs when there is inheritance - instead just recommend usage of...

Ok. What happens to pattern matching in that case?: ``` ruby class A include Contracts::Core Contract X => Y def something(x) x.y end Contract Z => C::Maybe[Y] def something(z) z.y...

@rfdonnelly Thanks for the specs! I will take a look into this soon.

Hi @kentfredric! Do you have a certain API for contracts in mind? Given the fact, that we already have some sort of `Validator` abstraction, which is used under the hood...

@alexanderdean As I thought. We are wrapping lambda over here: https://github.com/egonSchiele/contracts.ruby/blob/master/lib/contracts/call_with.rb#L90-L92 Therefore calling that lambda would work just fine, but not `#arity`. I believe we are violation LSP here, we...

@egonSchiele Maybe we could provide an alias with lowercase? Like `def_contract(...)` ?