remove unused sfProcvar, "procvar" mentions (#20204)

refs #12975. doesn't close it because wProcvar isn't removed
This commit is contained in:
metagn 2022-08-24 22:38:37 +03:00 • committed by GitHub
commit d143924ab2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View file

@ -260,7 +260,8 @@ type
# *OR*: a proc is indirectly called (used as first class) # *OR*: a proc is indirectly called (used as first class)
sfCompilerProc, # proc is a compiler proc, that is a C proc that is sfCompilerProc, # proc is a compiler proc, that is a C proc that is
# needed for the code generator # needed for the code generator
sfProcvar, # proc can be passed to a proc var sfEscapes # param escapes
# currently unimplemented
sfDiscriminant, # field is a discriminant in a record/object sfDiscriminant, # field is a discriminant in a record/object
sfRequiresInit, # field must be initialized during construction sfRequiresInit, # field must be initialized during construction
sfDeprecated, # symbol is deprecated sfDeprecated, # symbol is deprecated
@ -331,7 +332,7 @@ const
sfExperimental* = sfOverriden # module uses the .experimental switch sfExperimental* = sfOverriden # module uses the .experimental switch
sfGoto* = sfOverriden # var is used for 'goto' code generation sfGoto* = sfOverriden # var is used for 'goto' code generation
sfWrittenTo* = sfBorrow # param is assigned to sfWrittenTo* = sfBorrow # param is assigned to
sfEscapes* = sfProcvar # param escapes # currently unimplemented
sfBase* = sfDiscriminant sfBase* = sfDiscriminant
sfCustomPragma* = sfRegister # symbol is custom pragma template sfCustomPragma* = sfRegister # symbol is custom pragma template
sfTemplateRedefinition* = sfExportc # symbol is a redefinition of an earlier template sfTemplateRedefinition* = sfExportc # symbol is a redefinition of an earlier template

View file

@ -993,8 +993,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
of wNonReloadable: of wNonReloadable:
sym.flags.incl sfNonReloadable sym.flags.incl sfNonReloadable
of wProcVar: of wProcVar:
# old procvar annotation, no longer needed
noVal(c, it) noVal(c, it)
incl(sym.flags, sfProcvar)
of wExplain: of wExplain:
sym.flags.incl sfExplain sym.flags.incl sfExplain
of wDeprecated: of wDeprecated:
@ -1043,7 +1043,6 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
of wThread: of wThread:
noVal(c, it) noVal(c, it)
incl(sym.flags, sfThread) incl(sym.flags, sfThread)
incl(sym.flags, sfProcvar)
if sym.typ != nil: if sym.typ != nil:
incl(sym.typ.flags, tfThread) incl(sym.typ.flags, tfThread)
if sym.typ.callConv == ccClosure: sym.typ.callConv = ccNimCall if sym.typ.callConv == ccClosure: sym.typ.callConv = ccNimCall

View file

@ -562,7 +562,8 @@ proc procVarCheck(n: PNode; conf: ConfigRef) =
if n.kind in nkSymChoices: if n.kind in nkSymChoices:
for x in n: procVarCheck(x, conf) for x in n: procVarCheck(x, conf)
elif n.kind == nkSym and n.sym.magic != mNone and n.sym.kind in routineKinds: elif n.kind == nkSym and n.sym.magic != mNone and n.sym.kind in routineKinds:
localError(conf, n.info, "'$1' cannot be passed to a procvar" % n.sym.name.s) localError(conf, n.info, ("'$1' is a built-in and cannot be used as " &
"a first-class procedure") % n.sym.name.s)
proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) = proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) =
let n = n.skipConv let n = n.skipConv

View file

@ -8336,8 +8336,7 @@ violations of the `no heap sharing restriction`:idx:\: This restriction implies
that it is invalid to construct a data structure that consists of memory that it is invalid to construct a data structure that consists of memory
allocated from different (thread-local) heaps. allocated from different (thread-local) heaps.
A thread proc is passed to `createThread` or `spawn` and invoked A thread proc can be passed to `createThread` or `spawn`.
indirectly; so the `thread` pragma implies `procvar`.

View file

@ -1,5 +1,5 @@
discard """ discard """
errormsg: "'+' cannot be passed to a procvar" errormsg: "'+' is a built-in and cannot be used as a first-class procedure"
line: 8 line: 8
""" """