{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/2842","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2842/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2842/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2842/events","html_url":"https://github.com/crystal-lang/crystal/issues/2842","id":160482224,"number":2842,"title":"Bug: unknown assign target in type inference: x : String","user":{"login":"coderobe","id":8442384,"avatar_url":"https://avatars.githubusercontent.com/u/8442384?v=3","gravatar_id":"","url":"https://api.github.com/users/coderobe","html_url":"https://github.com/coderobe","followers_url":"https://api.github.com/users/coderobe/followers","following_url":"https://api.github.com/users/coderobe/following{/other_user}","gists_url":"https://api.github.com/users/coderobe/gists{/gist_id}","starred_url":"https://api.github.com/users/coderobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderobe/subscriptions","organizations_url":"https://api.github.com/users/coderobe/orgs","repos_url":"https://api.github.com/users/coderobe/repos","events_url":"https://api.github.com/users/coderobe/events{/privacy}","received_events_url":"https://api.github.com/users/coderobe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/compiler","name":"compiler","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-15T17:43:49Z","updated_at":"2016-06-15T17:46:11Z","closed_at":null,"body":"The following code  \r\n```crystal\r\ndef bug\r\n  x : String, y = [\"asd\", 123]\r\nend\r\nbug\r\n```\r\nproduces the following compiler error:  \r\n```\r\n> crystal compile --threads 4 -s bug.cr; and ./bug\r\nParse:                             00:00:00.0709706 (  15.82MB)\r\nSemantic (top level):              00:00:00.0461860 (  21.10MB)\r\nSemantic (new):                    00:00:00.0009557 (  21.10MB)\r\nSemantic (abstract def check):     00:00:00.0007677 (  21.10MB)\r\nSemantic (type declarations):      00:00:00.0105440 (  28.14MB)\r\nSemantic (cvars initializers):     00:00:00.0015437 (  28.14MB)\r\nSemantic (ivars initializers):     00:00:00.0005629 (  28.14MB)\r\nSemantic (main):                  Bug: unknown assign target in type inference: x : String\r\n[5655214] ???\r\n[10041066] ???\r\n[9689692] ???\r\n[9694457] ???\r\n[11519778] ???\r\n[9697294] ???\r\n[13086589] ???\r\n[6857462] ???\r\n[10103057] ???\r\n[9690329] ???\r\n[9694457] ???\r\n[14921107] ???\r\n[6830940] ???\r\n[5877641] ???\r\n[5752840] main +17736\r\n[140105114384193] __libc_start_main +241\r\n[5644425] _start +41\r\n[0] ???\r\n```  \r\n\r\nAlthough it should probably return  \r\n```\r\nin ./bug.cr:2: declaring the type of a local variable is not yet supported\r\n  x : String = \"asd\"\r\n  ^\r\n```  \r\n\r\nThis happens only when the type declaration is done whilst declaring multiple variables at once."},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/226264712","html_url":"https://github.com/crystal-lang/crystal/issues/2842#issuecomment-226264712","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2842","id":226264712,"user":{"login":"coderobe","id":8442384,"avatar_url":"https://avatars.githubusercontent.com/u/8442384?v=3","gravatar_id":"","url":"https://api.github.com/users/coderobe","html_url":"https://github.com/coderobe","followers_url":"https://api.github.com/users/coderobe/followers","following_url":"https://api.github.com/users/coderobe/following{/other_user}","gists_url":"https://api.github.com/users/coderobe/gists{/gist_id}","starred_url":"https://api.github.com/users/coderobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderobe/subscriptions","organizations_url":"https://api.github.com/users/coderobe/orgs","repos_url":"https://api.github.com/users/coderobe/repos","events_url":"https://api.github.com/users/coderobe/events{/privacy}","received_events_url":"https://api.github.com/users/coderobe/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T17:46:11Z","updated_at":"2016-06-15T17:46:11Z","body":"```crystal\r\ndef bug\r\n  x : Int32, y = 1\r\nend\r\nbug\r\n```\r\nseems to also trigger this.  \r\nthis takes complex types such as array and string out of the mix"}}
{"actor":{"display_login":"coderobe"}}