{"action":"opened","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/2157","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/2157/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/2157/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/2157/events","html_url":"https://github.com/ponylang/ponyc/issues/2157","id":249776742,"number":2157,"title":"Compiler assert when using `_` as an argument to Array","user":{"login":"dipinhora","id":11946442,"avatar_url":"https://avatars3.githubusercontent.com/u/11946442?v=4","gravatar_id":"","url":"https://api.github.com/users/dipinhora","html_url":"https://github.com/dipinhora","followers_url":"https://api.github.com/users/dipinhora/followers","following_url":"https://api.github.com/users/dipinhora/following{/other_user}","gists_url":"https://api.github.com/users/dipinhora/gists{/gist_id}","starred_url":"https://api.github.com/users/dipinhora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dipinhora/subscriptions","organizations_url":"https://api.github.com/users/dipinhora/orgs","repos_url":"https://api.github.com/users/dipinhora/repos","events_url":"https://api.github.com/users/dipinhora/events{/privacy}","received_events_url":"https://api.github.com/users/dipinhora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-12T00:38:20Z","updated_at":"2017-08-12T00:38:20Z","closed_at":null,"body":"In the following code:\r\n\r\n```pony\r\nactor Main\r\n  new create(env:Env) =>\r\n    let a = Array[U8]\r\n    a.push(_)\r\n```\r\n\r\nThe last line causes the following assert in the compiler:\r\n\r\n```\r\nvagrant@buffy-leader-1:~/ponyc$ ./build/debug/ponyc -d z\r\nBuilding builtin -> /home/vagrant/ponyc/packages/builtin\r\nBuilding z -> /home/vagrant/ponyc/z\r\nsrc/libponyc/type/safeto.c:51: safe_field_write: Assertion `0` failed.\r\n\r\nBacktrace:\r\n  ./build/debug/ponyc(ponyint_assert_fail+0xe9) [0x71da60]\r\n  ./build/debug/ponyc() [0x712f1d]\r\n  ./build/debug/ponyc(safe_to_autorecover+0x123) [0x7132af]\r\n  ./build/debug/ponyc() [0x6f6c0a]\r\n  ./build/debug/ponyc() [0x6f6e92]\r\n  ./build/debug/ponyc() [0x6f7675]\r\n  ./build/debug/ponyc() [0x6f77d0]\r\n  ./build/debug/ponyc(expr_call+0xf4) [0x6fa867]\r\n  ./build/debug/ponyc(pass_expr+0x223) [0x66f3c1]\r\n  ./build/debug/ponyc(ast_visit+0x261) [0x66d7c4]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc(ast_visit+0x1b3) [0x66d716]\r\n  ./build/debug/ponyc() [0x66ce8a]\r\n  ./build/debug/ponyc() [0x66d227]\r\n  ./build/debug/ponyc(ast_passes_program+0x28) [0x66d354]\r\n  ./build/debug/ponyc(program_load+0xbf) [0x668fc2]\r\n  ./build/debug/ponyc() [0x649cbd]\r\n  ./build/debug/ponyc(main+0x4cd) [0x64a207]\r\n  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7fa3fcfb8830]\r\n  ./build/debug/ponyc(_start+0x29) [0x649b09]\r\nAborted (core dumped)\r\n```\r\n\r\nThis same error also occurs if `_` is passed as an argument to any function except for a `constructor` of a class where I get an error that says `can't read from '_'`."}}
{"actor":{"display_login":"dipinhora"}}