mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
remove unused sfProcvar, "procvar" mentions (#20204)
refs #12975. doesn't close it because wProcvar isn't removed
This commit is contained in:
@@ -260,7 +260,8 @@ type
|
||||
# *OR*: a proc is indirectly called (used as first class)
|
||||
sfCompilerProc, # proc is a compiler proc, that is a C proc that is
|
||||
# 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
|
||||
sfRequiresInit, # field must be initialized during construction
|
||||
sfDeprecated, # symbol is deprecated
|
||||
@@ -331,7 +332,7 @@ const
|
||||
sfExperimental* = sfOverriden # module uses the .experimental switch
|
||||
sfGoto* = sfOverriden # var is used for 'goto' code generation
|
||||
sfWrittenTo* = sfBorrow # param is assigned to
|
||||
sfEscapes* = sfProcvar # param escapes
|
||||
# currently unimplemented
|
||||
sfBase* = sfDiscriminant
|
||||
sfCustomPragma* = sfRegister # symbol is custom pragma template
|
||||
sfTemplateRedefinition* = sfExportc # symbol is a redefinition of an earlier template
|
||||
|
||||
@@ -993,8 +993,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||
of wNonReloadable:
|
||||
sym.flags.incl sfNonReloadable
|
||||
of wProcVar:
|
||||
# old procvar annotation, no longer needed
|
||||
noVal(c, it)
|
||||
incl(sym.flags, sfProcvar)
|
||||
of wExplain:
|
||||
sym.flags.incl sfExplain
|
||||
of wDeprecated:
|
||||
@@ -1043,7 +1043,6 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||
of wThread:
|
||||
noVal(c, it)
|
||||
incl(sym.flags, sfThread)
|
||||
incl(sym.flags, sfProcvar)
|
||||
if sym.typ != nil:
|
||||
incl(sym.typ.flags, tfThread)
|
||||
if sym.typ.callConv == ccClosure: sym.typ.callConv = ccNimCall
|
||||
|
||||
@@ -562,7 +562,8 @@ proc procVarCheck(n: PNode; conf: ConfigRef) =
|
||||
if n.kind in nkSymChoices:
|
||||
for x in n: procVarCheck(x, conf)
|
||||
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) =
|
||||
let n = n.skipConv
|
||||
|
||||
@@ -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
|
||||
allocated from different (thread-local) heaps.
|
||||
|
||||
A thread proc is passed to `createThread` or `spawn` and invoked
|
||||
indirectly; so the `thread` pragma implies `procvar`.
|
||||
A thread proc can be passed to `createThread` or `spawn`.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
errormsg: "'+' cannot be passed to a procvar"
|
||||
errormsg: "'+' is a built-in and cannot be used as a first-class procedure"
|
||||
line: 8
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user