{"action":"created","issue":{"url":"https://api.github.com/repos/hkuplg/fcore/issues/70","labels_url":"https://api.github.com/repos/hkuplg/fcore/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/hkuplg/fcore/issues/70/comments","events_url":"https://api.github.com/repos/hkuplg/fcore/issues/70/events","html_url":"https://github.com/hkuplg/fcore/issues/70","id":59618253,"number":70,"title":"Unexpected compile error","user":{"login":"zonyitoo","id":1067951,"avatar_url":"https://avatars.githubusercontent.com/u/1067951?v=3","gravatar_id":"","url":"https://api.github.com/users/zonyitoo","html_url":"https://github.com/zonyitoo","followers_url":"https://api.github.com/users/zonyitoo/followers","following_url":"https://api.github.com/users/zonyitoo/following{/other_user}","gists_url":"https://api.github.com/users/zonyitoo/gists{/gist_id}","starred_url":"https://api.github.com/users/zonyitoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonyitoo/subscriptions","organizations_url":"https://api.github.com/users/zonyitoo/orgs","repos_url":"https://api.github.com/users/zonyitoo/repos","events_url":"https://api.github.com/users/zonyitoo/events{/privacy}","received_events_url":"https://api.github.com/users/zonyitoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hkuplg/fcore/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/hkuplg/fcore/labels/major","name":"major","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-03T09:51:49Z","updated_at":"2015-03-03T14:13:33Z","closed_at":null,"body":"```\r\ndata PolyList A = Nil\r\n                | Cons A (PolyList[A]);\r\n\r\ntype PolyString = PolyList[Char];\r\n\r\nlet rec fromString (str : String) : PolyString =\r\n    if length(str) == 0 then\r\n        (Nil[Char])\r\n    else\r\n        (Cons[Char] head(str) (fromString tail(str)));\r\n\r\nfromString \"abcdefg\"\r\n```\r\n\r\nIt seems that the compiler got into a infinity loop, because it replies\r\n\r\n```\r\ntest using [Naive]\r\nCompiling to Java source code ( ./Test.java )\r\nf2j: <<loop>>\r\n```"},"comment":{"url":"https://api.github.com/repos/hkuplg/fcore/issues/comments/76952091","html_url":"https://github.com/hkuplg/fcore/issues/70#issuecomment-76952091","issue_url":"https://api.github.com/repos/hkuplg/fcore/issues/70","id":76952091,"user":{"login":"zonyitoo","id":1067951,"avatar_url":"https://avatars.githubusercontent.com/u/1067951?v=3","gravatar_id":"","url":"https://api.github.com/users/zonyitoo","html_url":"https://github.com/zonyitoo","followers_url":"https://api.github.com/users/zonyitoo/followers","following_url":"https://api.github.com/users/zonyitoo/following{/other_user}","gists_url":"https://api.github.com/users/zonyitoo/gists{/gist_id}","starred_url":"https://api.github.com/users/zonyitoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonyitoo/subscriptions","organizations_url":"https://api.github.com/users/zonyitoo/orgs","repos_url":"https://api.github.com/users/zonyitoo/repos","events_url":"https://api.github.com/users/zonyitoo/events{/privacy}","received_events_url":"https://api.github.com/users/zonyitoo/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T14:13:33Z","updated_at":"2015-03-03T14:13:33Z","body":"@xnning Thank you for the solution, but this approach brings out a new question:\r\n\r\n```\r\nlet func (a : Char) = a;\r\nfunc \"abc\".charAt(0)\r\n```\r\n\r\nCompiler said expecting `Char` but found `char`.\r\n\r\nBut if I try to replace this piece of code to\r\n\r\n```\r\nlet func (a : Char) = a;\r\nfunc Char.valueOf(\"abc\".charAt(0))\r\n```\r\n\r\nCompiler complains that \r\n```\r\ntest_str using [Naive]\r\nCompiling to Java source code ( ./Test_str.java )\r\n./Test_str.java:17: 错误: 意外的类型\r\n    final java.lang.Character x6 = java.lang.Character.<char>valueOf(x5);\r\n                                                        ^\r\n  需要: 引用\r\n  找到:    char\r\n1 个错误\r\n错误: 找不到或无法加载主类 Test_str\r\nrm: *.class: No such file or directory\r\n```\r\n\r\nThose Chinese means that `<char>` is an unexpected type."}}