{"action":"opened","issue":{"url":"https://api.github.com/repos/fizzed/rocker/issues/79","repository_url":"https://api.github.com/repos/fizzed/rocker","labels_url":"https://api.github.com/repos/fizzed/rocker/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/fizzed/rocker/issues/79/comments","events_url":"https://api.github.com/repos/fizzed/rocker/issues/79/events","html_url":"https://github.com/fizzed/rocker/issues/79","id":295554233,"number":79,"title":"@with arguments are untyped","user":{"login":"jleeuwesc","id":32546118,"avatar_url":"https://avatars2.githubusercontent.com/u/32546118?v=4","gravatar_id":"","url":"https://api.github.com/users/jleeuwesc","html_url":"https://github.com/jleeuwesc","followers_url":"https://api.github.com/users/jleeuwesc/followers","following_url":"https://api.github.com/users/jleeuwesc/following{/other_user}","gists_url":"https://api.github.com/users/jleeuwesc/gists{/gist_id}","starred_url":"https://api.github.com/users/jleeuwesc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleeuwesc/subscriptions","organizations_url":"https://api.github.com/users/jleeuwesc/orgs","repos_url":"https://api.github.com/users/jleeuwesc/repos","events_url":"https://api.github.com/users/jleeuwesc/events{/privacy}","received_events_url":"https://api.github.com/users/jleeuwesc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-08T15:27:43Z","updated_at":"2018-02-08T15:27:43Z","closed_at":null,"author_association":"NONE","body":"First of all, thanks for this awesome project. Having compile-time safety in our templates makes refactorings a breeze. So much nicer than working with untyped template engines that blow up at runtime.\r\n\r\nOn to the actual bug report. The `@with` construct seems to ignore argument types. For instance, in this template:\r\n\r\n    @import java.util.List\r\n    @import java.util.Arrays\r\n    \r\n    @with (List<Integer> list = Arrays.asList(\"hello\", \"goodbye\")) {\r\n    \t@list.get(0)\r\n    }\r\n    \r\n    @with (String monkey = 4) {\r\n    \t@monkey\r\n    }\r\n\r\nI would expect Java to give type errors on the generated Java code, because a `List<String>` is assigned to a `List<Integer>` and `4` is assigned to a `String`.\r\n\r\nInstead, the types seem to be completely erased in the generated code:\r\n\r\n    @Override\r\n    protected void __doRender() throws IOException, RenderingException {\r\n    \t// WithBlockBegin @ [5:1]\r\n    \t__internal.aboutToExecutePosInTemplate(5, 1);\r\n    \tcom.fizzed.rocker.runtime.WithBlock.with(Arrays.asList(\"hello\", \"goodbye\"), false, (list) -> {\r\n    \t\t// ValueExpression @ [6:2]\r\n    \t\t__internal.aboutToExecutePosInTemplate(6, 2);\r\n    \t\t__internal.renderValue(list.get(0), false);\r\n    \t\t// PlainText @ [6:14]\r\n    \t\t__internal.aboutToExecutePosInTemplate(6, 14);\r\n    \t\t__internal.writeValue(PLAIN_TEXT_0_0);\r\n    \t\t// WithBlockEnd @ [5:1]\r\n    \t\t__internal.aboutToExecutePosInTemplate(5, 1);\r\n    \t}); // with end @ [5:1]\r\n    \t// PlainText @ [7:2]\r\n    \t__internal.aboutToExecutePosInTemplate(7, 2);\r\n    \t__internal.writeValue(PLAIN_TEXT_0_0);\r\n    \t// WithBlockBegin @ [9:1]\r\n    \t__internal.aboutToExecutePosInTemplate(9, 1);\r\n    \tcom.fizzed.rocker.runtime.WithBlock.with(4, false, (monkey) -> {\r\n    \t\t// PlainText @ [9:28]\r\n    \t\t__internal.aboutToExecutePosInTemplate(9, 28);\r\n    \t\t__internal.writeValue(PLAIN_TEXT_1_0);\r\n    \t\t// ValueExpression @ [10:2]\r\n    \t\t__internal.aboutToExecutePosInTemplate(10, 2);\r\n    \t\t__internal.renderValue(monkey, false);\r\n    \t\t// PlainText @ [10:9]\r\n    \t\t__internal.aboutToExecutePosInTemplate(10, 9);\r\n    \t\t__internal.writeValue(PLAIN_TEXT_0_0);\r\n    \t\t// WithBlockEnd @ [9:1]\r\n    \t\t__internal.aboutToExecutePosInTemplate(9, 1);\r\n    \t}); // with end @ [9:1]\r\n    }"}}
{"actor":{"display_login":"jleeuwesc"}}