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 can specify types for nonexistant arguments #291

Open
riley-klingler opened this issue Sep 18, 2019 · 0 comments
Open

Contracts can specify types for nonexistant arguments #291

riley-klingler opened this issue Sep 18, 2019 · 0 comments

Comments

@riley-klingler
Copy link

Example code:

Class A
    include Contracts::Core
    include Contracts::Builtin

   Contract Integer, Integer => String
   def self.hello
      return "Hello world!"
   end
end

puts A.hello

Actual behavior

No errors are raised

Expected behavior

I would expect this would an error, because the contract specifies hello takes two integers as arguments, and it is being passed none. I understand that this could be considered fine, as the code would work fine (without type errors) without the contract, but that is no different from any other incorrectly specified contract.

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

1 participant