Skip to content

Commit

Permalink
sem: rename newSymNode2 to newSymNodeOrError
Browse files Browse the repository at this point in the history
  • Loading branch information
zerbina committed Jul 6, 2024
1 parent e344bf6 commit 914441f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/sem/sem.nim
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ proc wrapErrorAndUpdate(c: ConfigRef, n: PNode, s: PSym): PNode =
result = c.wrapError(n)
s.ast = result

proc newSymNode2(c: ConfigRef, sym: PSym, info: TLineInfo): PNode =
proc newSymNodeOrError(c: ConfigRef, sym: PSym, info: TLineInfo): PNode =
## Creates a new `nkSym` node, unless `sym` either represents an error
## itself or refers to an erroneous entity. In the latter two cases, an
## error node is returned.
Expand Down
4 changes: 2 additions & 2 deletions compiler/sem/semexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode =
localReport(c.config, n, reportSem rsemIllegalNimvmContext)

markUsed(c, n.info, s)
result = newSymNode2(c.config, s, n.info)
result = newSymNodeOrError(c.config, s, n.info)
# We cannot check for access to outer vars for example because it's still
# not sure the symbol really ends up being used:
# var len = 0 # but won't be called
Expand Down Expand Up @@ -1664,7 +1664,7 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode =
else:
let info = getCallLineInfo(n)
markUsed(c, info, s)
result = newSymNode2(c.config, s, info)
result = newSymNodeOrError(c.config, s, info)

proc tryReadingGenericParam(c: PContext, n: PNode, i: PIdent, t: PType): PNode =
case t.kind
Expand Down

0 comments on commit 914441f

Please sign in to comment.