Skip to content
New issue

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

Contracts confused by block with Maybe? #244

Open
indigoviolet opened this issue Dec 12, 2016 · 2 comments
Open

Contracts confused by block with Maybe? #244

indigoviolet opened this issue Dec 12, 2016 · 2 comments

Comments

@indigoviolet
Copy link
Contributor

  class Bar
    include Contracts::Builtin
    include Contracts::Core

    Contract String, Maybe[Integer], Func[Any => Any] => Any
    def self.contract_foo(a, b=nil, &blk)
      puts [a, b, blk].to_json
    end
  end
[26] development (main)> Bar.contract_foo "a" do
[26] development (main)* end
ParamContractError: Contract violation for argument 2 of 2:
        Expected: (Integer or nil),
        Actual: #<Proc:0x0055dbc44fc388@(pry):31>
@indigoviolet
Copy link
Contributor Author

See #214

@egonSchiele
Copy link
Owner

I can reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants