{"action":"created","issue":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/139","labels_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/139/comments","events_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/139/events","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/139","id":70787490,"number":139,"title":"Combining Args and Optional Proc fails","user":{"login":"tdreyno","id":233,"avatar_url":"https://avatars.githubusercontent.com/u/233?v=3","gravatar_id":"","url":"https://api.github.com/users/tdreyno","html_url":"https://github.com/tdreyno","followers_url":"https://api.github.com/users/tdreyno/followers","following_url":"https://api.github.com/users/tdreyno/following{/other_user}","gists_url":"https://api.github.com/users/tdreyno/gists{/gist_id}","starred_url":"https://api.github.com/users/tdreyno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdreyno/subscriptions","organizations_url":"https://api.github.com/users/tdreyno/orgs","repos_url":"https://api.github.com/users/tdreyno/repos","events_url":"https://api.github.com/users/tdreyno/events{/privacy}","received_events_url":"https://api.github.com/users/tdreyno/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-24T20:34:30Z","updated_at":"2015-04-29T23:49:34Z","closed_at":"2015-04-29T02:56:47Z","body":"Example, which is the signature Rack uses for middleware:\r\n\r\n```\r\nContract Any, Args[Any], Maybe[Proc] => Any\r\ndef use(middleware, *args, &block)\r\n  @middleware << MiddlewareDescriptor.new(middleware, args, block)\r\nend\r\n```\r\n\r\nIn 0.9, the Args assumes the last value is either Proc or nil. But when no proc is passed, the last arg should be a part of the `*args`. Perhaps `Maybe` is not right for something so weirdly Ruby as the optional block usage.\r\n\r\nIn code:\r\n\r\n```\r\nuse ::Rack::Static, path: \"/\"\r\n```\r\n\r\nor\r\n\r\n```\r\nuse ::MinifyCSS do |m|\r\n  m.compressor = :yahoo\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/comments/97615836","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/139#issuecomment-97615836","issue_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/139","id":97615836,"user":{"login":"sfcgeorge","id":885003,"avatar_url":"https://avatars.githubusercontent.com/u/885003?v=3","gravatar_id":"","url":"https://api.github.com/users/sfcgeorge","html_url":"https://github.com/sfcgeorge","followers_url":"https://api.github.com/users/sfcgeorge/followers","following_url":"https://api.github.com/users/sfcgeorge/following{/other_user}","gists_url":"https://api.github.com/users/sfcgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/sfcgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfcgeorge/subscriptions","organizations_url":"https://api.github.com/users/sfcgeorge/orgs","repos_url":"https://api.github.com/users/sfcgeorge/repos","events_url":"https://api.github.com/users/sfcgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/sfcgeorge/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T23:49:34Z","updated_at":"2015-04-29T23:49:34Z","body":"@tdreyno Nope can't reproduce. Here's the code I used and no errors:\r\n\r\n```ruby\r\nContract RespondTo[:call], {\r\n  middleman_app: String,\r\n  id: Maybe[Symbol],\r\n  proc: Or[Proc, Method],\r\n  url_extensions: ArrayOf[String],\r\n  source_extensions: ArrayOf[String],\r\n  ignore: ArrayOf[Or[Regexp, RespondTo[:call], String]]\r\n} => Any\r\ndef crazy_hash(app, options = {})\r\nend\r\n\r\ncrazy_hash(proc {}, middleman_app: \"application\",\r\n                    id: :an_id,\r\n                    proc: proc {},\r\n                    url_extensions: [\"org\", \"com\"],\r\n                    source_extensions: [\"rb\", \"js\"],\r\n                    ignore: [\"foo\", /bar/])\r\n```\r\n\r\nI just inlined the hash and changed `Middleman::Application` to `String` so I didn't have to create a dummy class. Also, `IsA` isn't a contract, is that a custom contract you've defined or something? So I removed that.\r\n\r\nAs it works fine for me you'll have to open an issue with a simplified and reproducible test case please."}}