diff options
author | metagn <metagngn@gmail.com> | 2022-08-24 22:38:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 21:38:37 +0200 |
commit | d143924ab2e3914cb3ce0fedac5c5779832df3d8 (patch) | |
tree | 49e63ab2c306ba489ae696fedebe6f7b61d6c71a /compiler | |
parent | b6bfe38ff5283f77d5e5e78da06d2710bc16afb6 (diff) | |
download | Nim-d143924ab2e3914cb3ce0fedac5c5779832df3d8.tar.gz |
remove unused sfProcvar, "procvar" mentions (#20204)
refs #12975. doesn't close it because wProcvar isn't removed
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ast.nim | 5 | ||||
-rw-r--r-- | compiler/pragmas.nim | 3 | ||||
-rw-r--r-- | compiler/sempass2.nim | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 2ad700121..d569fee7b 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -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 diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index b662e09c5..06e861084 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -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 diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 1e3e41350..ae6d638e4 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -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 |