diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 5acfbc9192..f1d81f7983 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -626,7 +626,8 @@ proc deprecatedStmt(c: PContext; pragma: PNode) = for n in pragma: if n.kind in {nkExprColonExpr, nkExprEqExpr}: 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 alias = newSym(skAlias, src, dest, n[0].info) incl(alias.flags, sfExported) diff --git a/lib/pure/cgi.nim b/lib/pure/cgi.nim index 200a4adf18..fcf2cf99f5 100644 --- a/lib/pure/cgi.nim +++ b/lib/pure/cgi.nim @@ -74,8 +74,6 @@ proc decodeUrl*(s: string): string = inc(j) setLen(result, j) -{.deprecated: [URLDecode: decodeUrl, URLEncode: encodeUrl].} - proc addXmlChar(dest: var string, c: char) {.inline.} = case c of '&': add(dest, "&") @@ -101,8 +99,7 @@ type methodPost, ## query uses the POST method methodGet ## query uses the GET method -{.deprecated: [TRequestMethod: RequestMethod, ECgi: CgiError, - XMLencode: xmlEncode].} +{.deprecated: [TRequestMethod: RequestMethod, ECgi: CgiError].} proc cgiError*(msg: string) {.noreturn.} = ## raises an ECgi exception with message `msg`. diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 3f8a9574d6..d0f5c78e07 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -110,8 +110,6 @@ proc deduplicate*[T](s: openArray[T]): seq[T] = for itm in items(s): 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]] = ## Returns a new sequence with a combination of the two input containers. ## diff --git a/lib/pure/includes/oserr.nim b/lib/pure/includes/oserr.nim index dbb709f1b0..0889d73835 100644 --- a/lib/pure/includes/oserr.nim +++ b/lib/pure/includes/oserr.nim @@ -56,9 +56,6 @@ proc raiseOSError*(msg: string = "") {.noinline, rtl, extern: "nos$1", raise newException(OSError, msg) {.pop.} -when not defined(nimfix): - {.deprecated: [osError: raiseOSError].} - proc `==`*(err1, err2: OSErrorCode): bool {.borrow.} proc `$`*(err: OSErrorCode): string {.borrow.} diff --git a/lib/pure/scgi.nim b/lib/pure/scgi.nim index 711e4a8975..1ff26954e6 100644 --- a/lib/pure/scgi.nim +++ b/lib/pure/scgi.nim @@ -95,7 +95,7 @@ type AsyncScgiState* = ref AsyncScgiStateObj {.deprecated: [EScgi: ScgiError, TScgiState: ScgiState, - PAsyncScgiState: AsyncScgiState, scgiError: raiseScgiError].} + PAsyncScgiState: AsyncScgiState].} proc recvBuffer(s: var ScgiState, L: int) = if L > s.bufLen: diff --git a/lib/system.nim b/lib/system.nim index c1bf1a9199..1b53bf9f57 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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 ## platform specific programming. - when not defined(nimfix): - {.deprecated: [fileHandle: getFileHandle].} - when declared(newSeq): proc cstringArrayToSeq*(a: cstringArray, len: Natural): seq[string] = ## converts a ``cstringArray`` to a ``seq[string]``. `a` is supposed to be diff --git a/tests/stdlib/tgetfileinfo.nim b/tests/stdlib/tgetfileinfo.nim index 1c897b7024..019c2eb7ff 100644 --- a/tests/stdlib/tgetfileinfo.nim +++ b/tests/stdlib/tgetfileinfo.nim @@ -61,7 +61,7 @@ proc testGetFileInfo = block: let testFile = open(getAppFilename()) - testHandle = fileHandle(testFile) + testHandle = getFileHandle(testFile) try: discard getFileInfo(testFile) #echo("Handle : Valid File : Success")