{"action":"created","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/7310","repository_url":"https://api.github.com/repos/nim-lang/Nim","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/7310/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/7310/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/7310/events","html_url":"https://github.com/nim-lang/Nim/issues/7310","id":303294446,"number":7310,"title":" mixin value causes typechecker to fail","user":{"login":"krux02","id":929961,"avatar_url":"https://avatars2.githubusercontent.com/u/929961?v=4","gravatar_id":"","url":"https://api.github.com/users/krux02","html_url":"https://github.com/krux02","followers_url":"https://api.github.com/users/krux02/followers","following_url":"https://api.github.com/users/krux02/following{/other_user}","gists_url":"https://api.github.com/users/krux02/gists{/gist_id}","starred_url":"https://api.github.com/users/krux02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krux02/subscriptions","organizations_url":"https://api.github.com/users/krux02/orgs","repos_url":"https://api.github.com/users/krux02/repos","events_url":"https://api.github.com/users/krux02/events{/privacy}","received_events_url":"https://api.github.com/users/krux02/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-07T23:09:07Z","updated_at":"2018-03-08T21:50:18Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"```nim\r\nlet theEnvironment = \"default-env\"\r\n\r\nproc foobar_internal(env: string; arg: int): void =\r\n  echo \"form \", env, \" called foobar with arg: \", arg\r\n\r\ntemplate foobar(arg: int): void =\r\n  mixin theEnvironment\r\n  foobar_internal(theEnvironment, arg)\r\n\r\nfoobar(1)\r\nproc main(): void =\r\n  let theEnvironment = \"local-env\"\r\n  foobar(2)\r\nmain()\r\n```\r\n\r\ncompilation error:\r\n\r\n```\r\nnim c -r /tmp/scratch.nim\r\nHint: used config file '/home/arne/proj/nim/Nim/config/nim.cfg' [Conf]\r\nHint: system [Processing]\r\nHint: scratch [Processing]\r\nscratch.nim(11, 7) Error: type mismatch: got <string, int literal(1)>\r\nbut expected one of: \r\nproc foobar_internal(env: string; arg: int): void\r\n  first type mismatch at position: 1\r\n  required type: string\r\n  but expression 'theEnvironment' is of type: None\r\n\r\nexpression: foobar_internal(theEnvironment, 1)\r\n```\r\nIn the error it tells me that the first argument is of type string, but then later it tells it is of type `None`. That cannot be right."},"comment":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/comments/371636417","html_url":"https://github.com/nim-lang/Nim/issues/7310#issuecomment-371636417","issue_url":"https://api.github.com/repos/nim-lang/Nim/issues/7310","id":371636417,"user":{"login":"Araq","id":287816,"avatar_url":"https://avatars1.githubusercontent.com/u/287816?v=4","gravatar_id":"","url":"https://api.github.com/users/Araq","html_url":"https://github.com/Araq","followers_url":"https://api.github.com/users/Araq/followers","following_url":"https://api.github.com/users/Araq/following{/other_user}","gists_url":"https://api.github.com/users/Araq/gists{/gist_id}","starred_url":"https://api.github.com/users/Araq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Araq/subscriptions","organizations_url":"https://api.github.com/users/Araq/orgs","repos_url":"https://api.github.com/users/Araq/repos","events_url":"https://api.github.com/users/Araq/events{/privacy}","received_events_url":"https://api.github.com/users/Araq/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T21:50:18Z","updated_at":"2018-03-08T21:50:18Z","author_association":"OWNER","body":"Use a .dirty template and maybe ``bind foobar_internal``. "}}
{"actor":{"display_login":"Araq"}}