-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
completely consider void, giving discard check error again
- Loading branch information
Showing
4 changed files
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
discard """ | ||
errormsg: '''expression '"invalid"' is of type 'string' and has to be used (or discarded)''' | ||
line: 12 | ||
""" | ||
|
||
proc valid*(): string = | ||
let x = 317 | ||
"valid" | ||
|
||
proc invalid*(): string = | ||
result = "foo" | ||
"invalid" #[tt.Error | ||
^ cannot use implicit return, the `result` symbol was used in 'invalid'; got expression of type 'string']# | ||
"invalid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
discard """ | ||
errormsg: '''expression '"invalid"' is of type 'string' and has to be used (or discarded)''' | ||
line: 11 | ||
""" | ||
|
||
proc foo(x: var string) = | ||
x = "hello" | ||
|
||
proc bar(): string = | ||
foo(result) | ||
"invalid" #[tt.Error | ||
^ cannot use implicit return, the `result` symbol was used in 'bar'; got expression of type 'string']# | ||
"invalid" | ||
|
||
echo bar() |