add compile error for ignoring return value

also introduce the _ identifier which you can assign to
to discard a return value

closes #219
This commit is contained in:
Andrew Kelley
2017-02-24 15:00:47 -05:00
parent 3b40aaa01f
commit a665872e88
10 changed files with 102 additions and 53 deletions

View File

@@ -2928,6 +2928,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val) {
render_const_val_global(g, const_val, "");
switch (const_val->data.x_ptr.special) {
case ConstPtrSpecialInvalid:
case ConstPtrSpecialDiscard:
zig_unreachable();
case ConstPtrSpecialRef:
{