Fixes isNil errors for compatibility with latest Nim.
This commit is contained in:
parent
e06ad6e497
commit
8134427266
6 changed files with 3 additions and 10 deletions
|
|
@ -622,7 +622,6 @@ proc listPaths(options: Options) =
|
|||
## On success the proc returns normally.
|
||||
cli.setSuppressMessages(true)
|
||||
assert options.action.typ == actionPath
|
||||
assert(not options.action.packages.isNil)
|
||||
|
||||
if options.action.packages.len == 0:
|
||||
raise newException(NimbleError, "A package name needs to be specified")
|
||||
|
|
|
|||
|
|
@ -166,9 +166,6 @@ proc doDownload(url: string, downloadDir: string, verRange: VersionRange,
|
|||
meth
|
||||
if $latest.ver != "":
|
||||
result = latest.ver
|
||||
else:
|
||||
# Result should already be set to #head here.
|
||||
assert(not result.isNil)
|
||||
|
||||
removeDir(downloadDir)
|
||||
if verRange.kind == verSpecial:
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ proc getGlobal(g: ModuleGraph; ident: PSym): string =
|
|||
else:
|
||||
let n = vm.globalCtx.getGlobalValue(ident)
|
||||
if n.isStrLit:
|
||||
result = if n.strVal.isNil: "" else: n.strVal
|
||||
result = n.strVal
|
||||
else:
|
||||
raiseVariableError(ident.name.s, "string")
|
||||
|
||||
|
|
|
|||
|
|
@ -371,8 +371,7 @@ proc findPkg*(pkglist: seq[tuple[pkgInfo: PackageInfo, meta: MetaData]],
|
|||
if cmpIgnoreStyle(pkg.pkginfo.name, dep.name) != 0 and
|
||||
cmpIgnoreStyle(pkg.meta.url, dep.name) != 0: continue
|
||||
if withinRange(pkg.pkgInfo, dep.ver):
|
||||
let isNewer = (not r.version.isNil) and
|
||||
newVersion(r.version) < newVersion(pkg.pkginfo.version)
|
||||
let isNewer = newVersion(r.version) < newVersion(pkg.pkginfo.version)
|
||||
if not result or isNewer:
|
||||
r = pkg.pkginfo
|
||||
result = true
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ proc saveNimbleMeta*(pkgDestDir, url, vcsRevision: string,
|
|||
##
|
||||
## isLink - Determines whether the installed package is a .nimble-link.
|
||||
var nimblemeta = %{"url": %url}
|
||||
if not vcsRevision.isNil:
|
||||
if vcsRevision.len > 0:
|
||||
nimblemeta["vcsRevision"] = %vcsRevision
|
||||
let files = newJArray()
|
||||
nimblemeta["files"] = files
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@ proc `$`*(ver: Version): string {.borrow.}
|
|||
|
||||
proc hash*(ver: Version): Hash {.borrow.}
|
||||
|
||||
proc isNil*(ver: Version): bool {.borrow.}
|
||||
|
||||
proc newVersion*(ver: string): Version =
|
||||
doAssert(ver.len == 0 or ver[0] in {'#', '\0'} + Digits,
|
||||
"Wrong version: " & ver)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue