{"action":"created","issue":{"url":"https://api.github.com/repos/cwi-swat/rascal/issues/763","labels_url":"https://api.github.com/repos/cwi-swat/rascal/issues/763/labels{/name}","comments_url":"https://api.github.com/repos/cwi-swat/rascal/issues/763/comments","events_url":"https://api.github.com/repos/cwi-swat/rascal/issues/763/events","html_url":"https://github.com/cwi-swat/rascal/issues/763","id":55875231,"number":763,"title":"Rascal does not report error when not declaring explicit type in function parameter","user":{"login":"LemmingAvalanche","id":2229597,"avatar_url":"https://avatars.githubusercontent.com/u/2229597?v=3","gravatar_id":"","url":"https://api.github.com/users/LemmingAvalanche","html_url":"https://github.com/LemmingAvalanche","followers_url":"https://api.github.com/users/LemmingAvalanche/followers","following_url":"https://api.github.com/users/LemmingAvalanche/following{/other_user}","gists_url":"https://api.github.com/users/LemmingAvalanche/gists{/gist_id}","starred_url":"https://api.github.com/users/LemmingAvalanche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LemmingAvalanche/subscriptions","organizations_url":"https://api.github.com/users/LemmingAvalanche/orgs","repos_url":"https://api.github.com/users/LemmingAvalanche/repos","events_url":"https://api.github.com/users/LemmingAvalanche/events{/privacy}","received_events_url":"https://api.github.com/users/LemmingAvalanche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-29T09:23:26Z","updated_at":"2015-01-30T00:45:55Z","closed_at":null,"body":"Have this module in a project:\r\n\r\n```rascal\r\nmodule syn::Trouble\r\n\r\nint inc(x) = x + 1;\r\n```\r\n\r\nType this in the console:\r\n\r\n```\r\nrascal> import Data;\r\nrascal> import List;\r\n```\r\n\r\nSince `inc(...)` is not defined properly - there is no explicit type declaration for the parameter - we should get an error about this. But this still works:\r\n\r\n```\r\nrascal> inc(1);\r\nint: 2\r\n```\r\n\r\nInstead you may get another, seemingly unrelated error if `inc(...)` is used in a more complex expression. Like this:\r\n\r\n```\r\nrascal> list[int] y = [1,2,3];\r\nrascal> mapper(y, inc); \r\n|rascal://<path>|: insert into collection not supported on value and int\r\n☞ Advice\r\n```\r\n\r\nThe parameter type is checked in this case and it defaults to `value`, which was probably not intended.\r\n\r\n@jurgenvinju says that this issue should be fixed when the type checker is released.\r\n\r\n**Rascal versions:** `0.6.2.201312171007` and `0.7.1.201412090945`\r\n"},"comment":{"url":"https://api.github.com/repos/cwi-swat/rascal/issues/comments/72134379","html_url":"https://github.com/cwi-swat/rascal/issues/763#issuecomment-72134379","issue_url":"https://api.github.com/repos/cwi-swat/rascal/issues/763","id":72134379,"user":{"login":"mahills","id":805197,"avatar_url":"https://avatars.githubusercontent.com/u/805197?v=3","gravatar_id":"","url":"https://api.github.com/users/mahills","html_url":"https://github.com/mahills","followers_url":"https://api.github.com/users/mahills/followers","following_url":"https://api.github.com/users/mahills/following{/other_user}","gists_url":"https://api.github.com/users/mahills/gists{/gist_id}","starred_url":"https://api.github.com/users/mahills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahills/subscriptions","organizations_url":"https://api.github.com/users/mahills/orgs","repos_url":"https://api.github.com/users/mahills/repos","events_url":"https://api.github.com/users/mahills/events{/privacy}","received_events_url":"https://api.github.com/users/mahills/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T00:45:55Z","updated_at":"2015-01-30T00:45:55Z","body":"The checker requires names introduced in function parameters to be given explicit types, while the interpreter currently doesn't. So, as @jurgenvinju said, this will go away when the checker is in regular use."}}