{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/2848","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2848/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2848/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2848/events","html_url":"https://github.com/crystal-lang/crystal/issues/2848","id":160552993,"number":2848,"title":"Macro could not use default values in named arguments after an splat","user":{"login":"raydf","id":15605488,"avatar_url":"https://avatars.githubusercontent.com/u/15605488?v=3","gravatar_id":"","url":"https://api.github.com/users/raydf","html_url":"https://github.com/raydf","followers_url":"https://api.github.com/users/raydf/followers","following_url":"https://api.github.com/users/raydf/following{/other_user}","gists_url":"https://api.github.com/users/raydf/gists{/gist_id}","starred_url":"https://api.github.com/users/raydf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raydf/subscriptions","organizations_url":"https://api.github.com/users/raydf/orgs","repos_url":"https://api.github.com/users/raydf/repos","events_url":"https://api.github.com/users/raydf/events{/privacy}","received_events_url":"https://api.github.com/users/raydf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/compiler","name":"compiler","color":"fef2c0"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-06-16T00:24:15Z","updated_at":"2016-06-16T15:45:01Z","closed_at":null,"body":"I want to know if i'm using correctly the splats with named arguments for macros.\r\n\r\n```crystal\r\nrequire \"http/server\"\r\n\r\nabstract class Filter\r\n  def call(context : HTTP::Context)\r\n  end\r\nend\r\n\r\nmacro get(*routes, before, after = ([] of Filter | Filter | Nil), &block : -> T)\r\n  pp \"test\"\r\nend\r\n\r\nget \"/v2/security/users/\", param_test : String do |ctx|\r\n  pp \"hello\"\r\nend\r\n\r\n# get \"/v2/security/users/\", param_test : String, before: nil, after: nil do |ctx|\r\n#   pp \"hello\"\r\n# end\r\n\r\n```\r\n\r\nI'm working on an experimental web framework. The code in the comments works ok but the uncommented one throws this error:\r\n\r\n**`declaring the type of a local variable is not yet supported`**\r\n_`get \"/v2/security/users/\", param_test : String do |ctx|`_\r\n"},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/226526388","html_url":"https://github.com/crystal-lang/crystal/issues/2848#issuecomment-226526388","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2848","id":226526388,"user":{"login":"raydf","id":15605488,"avatar_url":"https://avatars.githubusercontent.com/u/15605488?v=3","gravatar_id":"","url":"https://api.github.com/users/raydf","html_url":"https://github.com/raydf","followers_url":"https://api.github.com/users/raydf/followers","following_url":"https://api.github.com/users/raydf/following{/other_user}","gists_url":"https://api.github.com/users/raydf/gists{/gist_id}","starred_url":"https://api.github.com/users/raydf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raydf/subscriptions","organizations_url":"https://api.github.com/users/raydf/orgs","repos_url":"https://api.github.com/users/raydf/repos","events_url":"https://api.github.com/users/raydf/events{/privacy}","received_events_url":"https://api.github.com/users/raydf/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T15:45:01Z","updated_at":"2016-06-16T15:45:01Z","body":"My bad, i'm still learning developing with macros and type restrictions. I'll move the type restriction to the routes loader generated functions. Thanks for all your help. \r\nEveryday i'm loving more to work with crystal and experimenting all the new features."}}
{"actor":{"display_login":"raydf"}}