Open
Description
The following results in an error, despite being completely valid code without the contracts.
class A
Contract None => B
def foo
B.new
end
end
class B
Contract None => A
def foo
A.new
end
end
puts A.new.foo
puts B.new.foo
Sure I could do something like
class A
end
class B
end
at the top of the file, but this is not a good solution.
Honestly, the more I think about it, the more I think contracts belong inside the method. This will make scope issues easier (I think) because contracts are executed within the context of the method anyway. This also could allow ruby to handle issues like #104 naturally.