forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix nim-lang#13115 properly (works for c,js,cpp,vm)
- Loading branch information
1 parent
157e782
commit 45e2250
Showing
2 changed files
with
29 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
discard """ | ||
exitcode: 1 | ||
targets: "c" | ||
targets: "c js cpp" | ||
matrix: "-d:debug; -d:release" | ||
outputsub: '''t13115.nim(13) t13115 | ||
Error: unhandled exception: This char is''' | ||
outputsub: ''' and works fine! [Exception]''' | ||
""" | ||
|
||
const b_null: char = 0.char | ||
var msg = "This char is `" & $b_null & "` and works fine!" | ||
# bug #13115 | ||
|
||
raise newException(Exception, msg) | ||
template fn = | ||
var msg = "This char is `" & '\0' & "` and works fine!" | ||
raise newException(Exception, msg) | ||
# static: fn() # would also work | ||
fn() |