{"action":"closed","issue":{"url":"https://api.github.com/repos/ziglang/zig/issues/1161","repository_url":"https://api.github.com/repos/ziglang/zig","labels_url":"https://api.github.com/repos/ziglang/zig/issues/1161/labels{/name}","comments_url":"https://api.github.com/repos/ziglang/zig/issues/1161/comments","events_url":"https://api.github.com/repos/ziglang/zig/issues/1161/events","html_url":"https://github.com/ziglang/zig/issues/1161","id":336195560,"node_id":"MDU6SXNzdWUzMzYxOTU1NjA=","number":1161,"title":"std/rand/ziggurat.zig:87:10: error: expected type 'type', found '*f64'","user":{"login":"bnoordhuis","id":275871,"node_id":"MDQ6VXNlcjI3NTg3MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/275871?v=4","gravatar_id":"","url":"https://api.github.com/users/bnoordhuis","html_url":"https://github.com/bnoordhuis","followers_url":"https://api.github.com/users/bnoordhuis/followers","following_url":"https://api.github.com/users/bnoordhuis/following{/other_user}","gists_url":"https://api.github.com/users/bnoordhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/bnoordhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnoordhuis/subscriptions","organizations_url":"https://api.github.com/users/bnoordhuis/orgs","repos_url":"https://api.github.com/users/bnoordhuis/repos","events_url":"https://api.github.com/users/bnoordhuis/events{/privacy}","received_events_url":"https://api.github.com/users/bnoordhuis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-27T11:49:28Z","updated_at":"2018-06-27T16:31:49Z","closed_at":"2018-06-27T16:31:49Z","author_association":"MEMBER","body":"At commit 4de60dde.\r\n```zig\r\nconst std = @import(\"std\");\r\n\r\ntest \"rand\" {\r\n    var r = std.rand.Random { .fillFn = fill };\r\n    var _ = r.floatNorm(f32);\r\n}\r\n\r\nfn fill(r: *std.rand.Random, buf: []u8) void {\r\n    std.os.getRandomBytes(buf) catch @panic(\"getRandomBytes() failure\");\r\n}\r\n```\r\nProduces:\r\n```\r\n$ build/zig test tmp/t.zig \r\n/home/bnoordhuis/src/zig/build/lib/zig/std/rand/ziggurat.zig:87:10: error: expected type 'type', found '*f64'\r\n        *entry = f_inv(v / last + f(last));\r\n         ^\r\n/home/bnoordhuis/src/zig/build/lib/zig/std/rand/ziggurat.zig:101:27: note: called from here\r\n    break :blk ZigTableGen(true, norm_r, norm_v, norm_f, norm_f_inv, norm_zero_case);\r\n                          ^\r\n/home/bnoordhuis/src/zig/build/lib/zig/std/rand/ziggurat.zig:99:27: note: called from here\r\npub const NormDist = blk: {\r\n```\r\nBacktrace:\r\n```\r\nBreakpoint 1, ir_resolve_type (ira=0x555556f09180, type_value=0x5555570be940) at /home/bnoordhuis/src/zig/src/ir.cpp:9225\r\n9225            ir_add_error(ira, type_value,\r\n(gdb) bt\r\n#0  ir_resolve_type (ira=0x555556f09180, type_value=0x5555570be940) at /home/bnoordhuis/src/zig/src/ir.cpp:9225\r\n#1  0x0000555555b7beb3 in ir_analyze_instruction_ptr_type (ira=0x555556f09180, instruction=0x555556f04120) at /home/bnoordhuis/src/zig/src/ir.cpp:19489\r\n#2  0x0000555555b7f1e1 in ir_analyze_instruction_nocast (ira=0x555556f09180, instruction=0x555556f04120) at /home/bnoordhuis/src/zig/src/ir.cpp:20393\r\n#3  0x0000555555b7f568 in ir_analyze_instruction (ira=0x555556f09180, instruction=0x555556f04120) at /home/bnoordhuis/src/zig/src/ir.cpp:20469\r\n#4  0x0000555555b7f85c in ir_analyze (codegen=0x55555653b9f0, old_exec=0x555556efd2d0, new_exec=0x555556f09090, expected_type=0x555556ee67a0, expected_type_source_node=0x555556ed29a0) at /home/bnoordhuis/src/zig/src/ir.cpp:20524\r\n#5  0x0000555555b55522 in ir_eval_const_value (codegen=0x55555653b9f0, scope=0x555556efc760, node=0x555556ed29a0, expected_type=0x555556ee67a0, backward_branch_count=0x7fffffffd0e0, backward_branch_quota=30000, fn_entry=0x555556eefb70, c_import_buf=0x0, source_node=0x555556ed6b90, exec_name=0x0, parent_exec=0x555556eef5c0) at /home/bnoordhuis/src/zig/src/ir.cpp:9207\r\n#6  0x0000555555b61ca4 in ir_analyze_fn_call (ira=0x555556eef6b0, call_instruction=0x555556eef0c0, fn_entry=0x555556eefb70, fn_type=0x555556ef08c0, fn_ref=0x555556ef0a20, first_arg_ptr=0x0, comptime_fn_call=true, fn_inline=FnInlineAuto) at /home/bnoordhuis/src/zig/src/ir.cpp:12592\r\n#7  0x0000555555b63995 in ir_analyze_instruction_call (ira=0x555556eef6b0, call_instruction=0x555556eef0c0) at /home/bnoordhuis/src/zig/src/ir.cpp:13010\r\n#8  0x0000555555b7ea19 in ir_analyze_instruction_nocast (ira=0x555556eef6b0, instruction=0x555556eef0c0) at /home/bnoordhuis/src/zig/src/ir.cpp:20227\r\n#9  0x0000555555b7f568 in ir_analyze_instruction (ira=0x555556eef6b0, instruction=0x555556eef0c0) at /home/bnoordhuis/src/zig/src/ir.cpp:20469\r\n#10 0x0000555555b7f85c in ir_analyze (codegen=0x55555653b9f0, old_exec=0x555556eee330, new_exec=0x555556eef5c0, expected_type=0x0, expected_type_source_node=0x555556ed6730) at /home/bnoordhuis/src/zig/src/ir.cpp:20524\r\n#11 0x0000555555b55522 in ir_eval_const_value (codegen=0x55555653b9f0, scope=0x555556ee01a0, node=0x555556ed6730, expected_type=0x0, backward_branch_count=0x7fffffffd0e0, backward_branch_quota=1000, fn_entry=0x0, c_import_buf=0x0, source_node=0x555556ed6730, exec_name=0x555556ebcf38, parent_exec=0x0) at /home/bnoordhuis/src/zig/src/ir.cpp:9207\r\n#12 0x0000555555aefb4a in analyze_const_value (g=0x55555653b9f0, scope=0x555556ee01a0, node=0x555556ed6730, type_entry=0x0, type_name=0x555556ebcf38) at /home/bnoordhuis/src/zig/src/analyze.cpp:1226\r\n#13 0x0000555555af7af8 in resolve_decl_var (g=0x55555653b9f0, tld_var=0x555556ee03f0) at /home/bnoordhuis/src/zig/src/analyze.cpp:3499\r\n#14 0x0000555555af7faf in resolve_top_level_decl (g=0x55555653b9f0, tld=0x555556ee03f0, pointer_only=false, source_node=0x5555567175f0) at /home/bnoordhuis/src/zig/src/analyze.cpp:3573\r\n#15 0x0000555555b66fb5 in ir_analyze_decl_ref (ira=0x555556ea7430, source_instruction=0x555556ea3ab0, tld=0x555556ee03f0) at /home/bnoordhuis/src/zig/src/ir.cpp:13901\r\n#16 0x0000555555b69024 in ir_analyze_instruction_field_ptr (ira=0x555556ea7430, field_ptr_instruction=0x555556ea3ab0) at /home/bnoordhuis/src/zig/src/ir.cpp:14330\r\n#17 0x0000555555b7ea01 in ir_analyze_instruction_nocast (ira=0x555556ea7430, instruction=0x555556ea3ab0) at /home/bnoordhuis/src/zig/src/ir.cpp:20225\r\n#18 0x0000555555b7f568 in ir_analyze_instruction (ira=0x555556ea7430, instruction=0x555556ea3ab0) at /home/bnoordhuis/src/zig/src/ir.cpp:20469\r\n#19 0x0000555555b7f85c in ir_analyze (codegen=0x55555653b9f0, old_exec=0x555556770ec0, new_exec=0x555556770fa8, expected_type=0x5555565546d0, expected_type_source_node=0x555556717000) at /home/bnoordhuis/src/zig/src/ir.cpp:20524\r\n#20 0x0000555555af8ea2 in analyze_fn_ir (g=0x55555653b9f0, fn_table_entry=0x555556770e50, return_type_node=0x555556717000) at /home/bnoordhuis/src/zig/src/analyze.cpp:3958\r\n#21 0x0000555555af932e in analyze_fn_body (g=0x55555653b9f0, fn_table_entry=0x555556770e50) at /home/bnoordhuis/src/zig/src/analyze.cpp:4045\r\n#22 0x0000555555af9f4d in semantic_analyze (g=0x55555653b9f0) at /home/bnoordhuis/src/zig/src/analyze.cpp:4250\r\n#23 0x0000555555b2e57a in gen_root_source (g=0x55555653b9f0) at /home/bnoordhuis/src/zig/src/codegen.cpp:7087\r\n#24 0x0000555555b302ea in codegen_build (g=0x55555653b9f0) at /home/bnoordhuis/src/zig/src/codegen.cpp:7600\r\n#25 0x0000555555b9ab82 in main (argc=3, argv=0x7fffffffdb18) at /home/bnoordhuis/src/zig/src/main.cpp:942\r\n```"}}
{"actor":{"display_login":"andrewrk"}}