-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sem): fix crash routine pragma redefinition (#1445)
## Summary The compiler no longer crashes when encountering a pragma redefinition error on a routine. This was due to unnecessary asserts in error message code ## Details * dropped the asserts that added no value * dropped the redundancy in the error message itself, no need to repeat the symbol for the definition, as they will be the same * error message generation now properly uses string format ( `%` ) instead of concatenation Fixes #1444 --------- Co-authored-by: zerbina <[email protected]>
- Loading branch information
Showing
4 changed files
with
17 additions
and
10 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
8 changes: 8 additions & 0 deletions
8
tests/lang_callable/tpragma_redefinition_on_routine_def_err.nim
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
discard """ | ||
description: "Error when routine def has pragma not in prototype" | ||
errormsg: "pragmas are only allowed in the header of a routine; 'a'" | ||
line: 8 | ||
""" | ||
|
||
proc a() | ||
proc a() {.gcsafe.} = discard |