{"action":"created","issue":{"url":"https://api.github.com/repos/phpstan/phpstan/issues/289","repository_url":"https://api.github.com/repos/phpstan/phpstan","labels_url":"https://api.github.com/repos/phpstan/phpstan/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/phpstan/phpstan/issues/289/comments","events_url":"https://api.github.com/repos/phpstan/phpstan/issues/289/events","html_url":"https://github.com/phpstan/phpstan/issues/289","id":229063321,"number":289,"title":"Reassignment of variables defined in argument list does not respect types","user":{"login":"Fuco1","id":2664959,"avatar_url":"https://avatars3.githubusercontent.com/u/2664959?v=3","gravatar_id":"","url":"https://api.github.com/users/Fuco1","html_url":"https://github.com/Fuco1","followers_url":"https://api.github.com/users/Fuco1/followers","following_url":"https://api.github.com/users/Fuco1/following{/other_user}","gists_url":"https://api.github.com/users/Fuco1/gists{/gist_id}","starred_url":"https://api.github.com/users/Fuco1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fuco1/subscriptions","organizations_url":"https://api.github.com/users/Fuco1/orgs","repos_url":"https://api.github.com/users/Fuco1/repos","events_url":"https://api.github.com/users/Fuco1/events{/privacy}","received_events_url":"https://api.github.com/users/Fuco1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-16T14:56:00Z","updated_at":"2017-05-16T15:01:35Z","closed_at":null,"body":"```php\r\n        public function x(bool $a, string $b)\r\n\t{\r\n\t\t$a = $b;\r\n\t}\r\n```\r\n\r\nproduces no error on 0.7.  Should it?  I feel like it should, because `$a` might be passed somewhere else later in the body but it is now a string."},"comment":{"url":"https://api.github.com/repos/phpstan/phpstan/issues/comments/301810534","html_url":"https://github.com/phpstan/phpstan/issues/289#issuecomment-301810534","issue_url":"https://api.github.com/repos/phpstan/phpstan/issues/289","id":301810534,"user":{"login":"Fuco1","id":2664959,"avatar_url":"https://avatars3.githubusercontent.com/u/2664959?v=3","gravatar_id":"","url":"https://api.github.com/users/Fuco1","html_url":"https://github.com/Fuco1","followers_url":"https://api.github.com/users/Fuco1/followers","following_url":"https://api.github.com/users/Fuco1/following{/other_user}","gists_url":"https://api.github.com/users/Fuco1/gists{/gist_id}","starred_url":"https://api.github.com/users/Fuco1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fuco1/subscriptions","organizations_url":"https://api.github.com/users/Fuco1/orgs","repos_url":"https://api.github.com/users/Fuco1/repos","events_url":"https://api.github.com/users/Fuco1/events{/privacy}","received_events_url":"https://api.github.com/users/Fuco1/received_events","type":"User","site_admin":false},"created_at":"2017-05-16T15:01:35Z","updated_at":"2017-05-16T15:01:35Z","body":"Compare the following C code\r\n\r\n```c\r\nstruct point {\r\n  int x;\r\n  int y;\r\n};\r\n\r\nint x(int a, struct point b)\r\n{\r\n  a = b;\r\n}\r\n```\r\n\r\nThis produces compile error\r\n\r\n```\r\n[16:59:38]matus@brno-pc-02:~/dev\r\n> gcc -c foo.c\r\nfoo.c: In function ‘x’:\r\nfoo.c:8:5: error: incompatible types when assigning to type ‘int’ from type ‘struct point’\r\n   a = b;\r\n     ^\r\n```\r\n\r\nI agree that it's not very good practice to reuse the variables, but having types and all this should not be valid if we are trying to preserve semantics."}}
{"actor":{"display_login":"Fuco1"}}