diff options
-rw-r--r-- | compiler/semstmts.nim | 4 | ||||
-rw-r--r-- | tests/discard/tneedsdiscard.nim | 2 | ||||
-rw-r--r-- | tests/discard/tneedsdiscard_in_for.nim | 2 | ||||
-rw-r--r-- | tests/discard/tvoidcontext.nim | 2 | ||||
-rw-r--r-- | tests/errmsgs/tdont_show_system.nim | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 22055a33d..0e018dd0b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -12,7 +12,7 @@ const errNoSymbolToBorrowFromFound = "no symbol to borrow from found" - errDiscardValueX = "value of type '$1' has to be discarded" + errDiscardValueX = "value of type '$1' has to be used (or discarded)" errInvalidDiscard = "statement returns no value that can be discarded" errInvalidControlFlowX = "invalid control flow: $1" errSelectorMustBeOfCertainTypes = "selector must be of an ordinal type, float or string" @@ -144,7 +144,7 @@ proc discardCheck(c: PContext, result: PNode, flags: TExprFlags) = var n = result while n.kind in skipForDiscardable: n = n.lastSon var s = "expression '" & $n & "' is of type '" & - result.typ.typeToString & "' and has to be discarded" + result.typ.typeToString & "' and has to be used (or discarded)" if result.info.line != n.info.line or result.info.fileIndex != n.info.fileIndex: s.add "; start of expression here: " & c.config$result.info diff --git a/tests/discard/tneedsdiscard.nim b/tests/discard/tneedsdiscard.nim index d9483947f..75cd9d2df 100644 --- a/tests/discard/tneedsdiscard.nim +++ b/tests/discard/tneedsdiscard.nim @@ -1,5 +1,5 @@ discard """ - errormsg: '''expression 'open(f, "arg.txt", fmRead, -1)' is of type 'bool' and has to be discarded; start of expression here: tneedsdiscard.nim(7, 3)''' + errormsg: '''expression 'open(f, "arg.txt", fmRead, -1)' is of type 'bool' and has to be used (or discarded); start of expression here: tneedsdiscard.nim(7, 3)''' line: 10 """ diff --git a/tests/discard/tneedsdiscard_in_for.nim b/tests/discard/tneedsdiscard_in_for.nim index ab5216150..7685bd577 100644 --- a/tests/discard/tneedsdiscard_in_for.nim +++ b/tests/discard/tneedsdiscard_in_for.nim @@ -1,5 +1,5 @@ discard """ - errormsg: '''expression 'premultiply(app.gradient[i])' is of type 'Rgba8' and has to be discarded''' + errormsg: '''expression 'premultiply(app.gradient[i])' is of type 'Rgba8' and has to be used (or discarded)''' line: 22 """ diff --git a/tests/discard/tvoidcontext.nim b/tests/discard/tvoidcontext.nim index 25e0d4fdf..9e2b913ad 100644 --- a/tests/discard/tvoidcontext.nim +++ b/tests/discard/tvoidcontext.nim @@ -1,5 +1,5 @@ discard """ - errormsg: '''expression '"invalid"' is of type 'string' and has to be discarded''' + errormsg: '''expression '"invalid"' is of type 'string' and has to be used (or discarded)''' line: 12 """ diff --git a/tests/errmsgs/tdont_show_system.nim b/tests/errmsgs/tdont_show_system.nim index 830113218..164fdd801 100644 --- a/tests/errmsgs/tdont_show_system.nim +++ b/tests/errmsgs/tdont_show_system.nim @@ -1,5 +1,5 @@ discard """ - errormsg: "expression 'true' is of type 'bool' and has to be discarded" + errormsg: "expression 'true' is of type 'bool' and has to be used (or discarded)" line: 13 file: "tdont_show_system.nim" """ |