Skip to content

Commit

Permalink
replace with newSym
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Sep 28, 2023
1 parent 35b4d59 commit 9d258d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions compiler/ast/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,6 @@ template transitionSymKindCommon*(k: TSymKind) =
when defined(nimsuggest):
s.allUsages = obj.allUsages

proc transitionSymKindCommon*(s: PSym, kind: TSymKind) =
transitionSymKindCommon(kind)

proc transitionGenericParamToType*(s: PSym) =
transitionSymKindCommon(skType)

Expand Down
4 changes: 1 addition & 3 deletions compiler/sem/sem.nim
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,7 @@ proc newSymGNode*(kind: TSymKind, n: PNode, c: PContext): PNode =
n.sym.owner = currOwner # xxx: modifying the sym owner is suss
n
else:
let recoverySym = copySym(n.sym, nextSymId c.idgen)
recoverySym.transitionSymKindCommon(kind)
recoverySym.owner = currOwner
let recoverySym = newSym(kind, n.sym.name, nextSymId c.idgen, currOwner, info)
c.config.makeError(n, recoverySym, ExpectedKindMismatch)
of nkIdent, nkAccQuoted:
# xxx: sym choices qualify here, but shouldn't those be errors in
Expand Down

0 comments on commit 9d258d7

Please sign in to comment.