added a warning that the .deprecate statement is unreliable for routines
This commit is contained in:
parent
0e67fc7450
commit
58187f2120
7 changed files with 5 additions and 15 deletions
|
|
@ -626,7 +626,8 @@ proc deprecatedStmt(c: PContext; pragma: PNode) =
|
||||||
for n in pragma:
|
for n in pragma:
|
||||||
if n.kind in {nkExprColonExpr, nkExprEqExpr}:
|
if n.kind in {nkExprColonExpr, nkExprEqExpr}:
|
||||||
let dest = qualifiedLookUp(c, n[1], {checkUndeclared})
|
let dest = qualifiedLookUp(c, n[1], {checkUndeclared})
|
||||||
assert dest != nil
|
if dest == nil or dest.kind in routineKinds:
|
||||||
|
localError(n.info, warnUser, "the .deprecated pragma is unreliable for routines")
|
||||||
let src = considerQuotedIdent(n[0])
|
let src = considerQuotedIdent(n[0])
|
||||||
let alias = newSym(skAlias, src, dest, n[0].info)
|
let alias = newSym(skAlias, src, dest, n[0].info)
|
||||||
incl(alias.flags, sfExported)
|
incl(alias.flags, sfExported)
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,6 @@ proc decodeUrl*(s: string): string =
|
||||||
inc(j)
|
inc(j)
|
||||||
setLen(result, j)
|
setLen(result, j)
|
||||||
|
|
||||||
{.deprecated: [URLDecode: decodeUrl, URLEncode: encodeUrl].}
|
|
||||||
|
|
||||||
proc addXmlChar(dest: var string, c: char) {.inline.} =
|
proc addXmlChar(dest: var string, c: char) {.inline.} =
|
||||||
case c
|
case c
|
||||||
of '&': add(dest, "&")
|
of '&': add(dest, "&")
|
||||||
|
|
@ -101,8 +99,7 @@ type
|
||||||
methodPost, ## query uses the POST method
|
methodPost, ## query uses the POST method
|
||||||
methodGet ## query uses the GET method
|
methodGet ## query uses the GET method
|
||||||
|
|
||||||
{.deprecated: [TRequestMethod: RequestMethod, ECgi: CgiError,
|
{.deprecated: [TRequestMethod: RequestMethod, ECgi: CgiError].}
|
||||||
XMLencode: xmlEncode].}
|
|
||||||
|
|
||||||
proc cgiError*(msg: string) {.noreturn.} =
|
proc cgiError*(msg: string) {.noreturn.} =
|
||||||
## raises an ECgi exception with message `msg`.
|
## raises an ECgi exception with message `msg`.
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,6 @@ proc deduplicate*[T](s: openArray[T]): seq[T] =
|
||||||
for itm in items(s):
|
for itm in items(s):
|
||||||
if not result.contains(itm): result.add(itm)
|
if not result.contains(itm): result.add(itm)
|
||||||
|
|
||||||
{.deprecated: [distnct: deduplicate].}
|
|
||||||
|
|
||||||
proc zip*[S, T](s1: openArray[S], s2: openArray[T]): seq[tuple[a: S, b: T]] =
|
proc zip*[S, T](s1: openArray[S], s2: openArray[T]): seq[tuple[a: S, b: T]] =
|
||||||
## Returns a new sequence with a combination of the two input containers.
|
## Returns a new sequence with a combination of the two input containers.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,6 @@ proc raiseOSError*(msg: string = "") {.noinline, rtl, extern: "nos$1",
|
||||||
raise newException(OSError, msg)
|
raise newException(OSError, msg)
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
||||||
when not defined(nimfix):
|
|
||||||
{.deprecated: [osError: raiseOSError].}
|
|
||||||
|
|
||||||
proc `==`*(err1, err2: OSErrorCode): bool {.borrow.}
|
proc `==`*(err1, err2: OSErrorCode): bool {.borrow.}
|
||||||
proc `$`*(err: OSErrorCode): string {.borrow.}
|
proc `$`*(err: OSErrorCode): string {.borrow.}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ type
|
||||||
AsyncScgiState* = ref AsyncScgiStateObj
|
AsyncScgiState* = ref AsyncScgiStateObj
|
||||||
|
|
||||||
{.deprecated: [EScgi: ScgiError, TScgiState: ScgiState,
|
{.deprecated: [EScgi: ScgiError, TScgiState: ScgiState,
|
||||||
PAsyncScgiState: AsyncScgiState, scgiError: raiseScgiError].}
|
PAsyncScgiState: AsyncScgiState].}
|
||||||
|
|
||||||
proc recvBuffer(s: var ScgiState, L: int) =
|
proc recvBuffer(s: var ScgiState, L: int) =
|
||||||
if L > s.bufLen:
|
if L > s.bufLen:
|
||||||
|
|
|
||||||
|
|
@ -3118,9 +3118,6 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
## returns the OS file handle of the file ``f``. This is only useful for
|
## returns the OS file handle of the file ``f``. This is only useful for
|
||||||
## platform specific programming.
|
## platform specific programming.
|
||||||
|
|
||||||
when not defined(nimfix):
|
|
||||||
{.deprecated: [fileHandle: getFileHandle].}
|
|
||||||
|
|
||||||
when declared(newSeq):
|
when declared(newSeq):
|
||||||
proc cstringArrayToSeq*(a: cstringArray, len: Natural): seq[string] =
|
proc cstringArrayToSeq*(a: cstringArray, len: Natural): seq[string] =
|
||||||
## converts a ``cstringArray`` to a ``seq[string]``. `a` is supposed to be
|
## converts a ``cstringArray`` to a ``seq[string]``. `a` is supposed to be
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ proc testGetFileInfo =
|
||||||
block:
|
block:
|
||||||
let
|
let
|
||||||
testFile = open(getAppFilename())
|
testFile = open(getAppFilename())
|
||||||
testHandle = fileHandle(testFile)
|
testHandle = getFileHandle(testFile)
|
||||||
try:
|
try:
|
||||||
discard getFileInfo(testFile)
|
discard getFileInfo(testFile)
|
||||||
#echo("Handle : Valid File : Success")
|
#echo("Handle : Valid File : Success")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue