* fix #17941: UnusedImport works for var/let/const/type invoked inside a generic * fixup
This commit is contained in:
parent
e224865b3b
commit
38b41f893a
4 changed files with 6 additions and 4 deletions
|
|
@ -189,6 +189,9 @@ proc semGenericStmt(c: PContext, n: PNode,
|
||||||
case n.kind
|
case n.kind
|
||||||
of nkIdent, nkAccQuoted:
|
of nkIdent, nkAccQuoted:
|
||||||
result = lookup(c, n, flags, ctx)
|
result = lookup(c, n, flags, ctx)
|
||||||
|
if result != nil and result.kind == nkSym:
|
||||||
|
assert result.sym != nil
|
||||||
|
markUsed(c, n.info, result.sym)
|
||||||
of nkDotExpr:
|
of nkDotExpr:
|
||||||
#let luf = if withinMixin notin flags: {checkUndeclared} else: {}
|
#let luf = if withinMixin notin flags: {checkUndeclared} else: {}
|
||||||
#var s = qualifiedLookUp(c, n, luf)
|
#var s = qualifiedLookUp(c, n, luf)
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ template encodeInternal(s, alphabet: typed): untyped =
|
||||||
result.setLen(outputIndex)
|
result.setLen(outputIndex)
|
||||||
|
|
||||||
template encodeImpl() {.dirty.} =
|
template encodeImpl() {.dirty.} =
|
||||||
when nimVM:
|
when nimvm:
|
||||||
block:
|
block:
|
||||||
let lookupTableVM = if safe: cb64safeVM else: cb64VM
|
let lookupTableVM = if safe: cb64safeVM else: cb64VM
|
||||||
encodeInternal(s, lookupTableVM)
|
encodeInternal(s, lookupTableVM)
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ proc expandIfNeeded[T](deq: var Deque[T]) =
|
||||||
var n = newSeq[T](cap * 2)
|
var n = newSeq[T](cap * 2)
|
||||||
var i = 0
|
var i = 0
|
||||||
for x in mitems(deq):
|
for x in mitems(deq):
|
||||||
when nimVM: n[i] = x # workaround for VM bug
|
when nimvm: n[i] = x # workaround for VM bug
|
||||||
else: n[i] = move(x)
|
else: n[i] = move(x)
|
||||||
inc i
|
inc i
|
||||||
deq.data = move(n)
|
deq.data = move(n)
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,7 @@ type
|
||||||
OsPlatform* {.pure.} = enum ## the OS this program will run on.
|
OsPlatform* {.pure.} = enum ## the OS this program will run on.
|
||||||
none, dos, windows, os2, linux, morphos, skyos, solaris,
|
none, dos, windows, os2, linux, morphos, skyos, solaris,
|
||||||
irix, netbsd, freebsd, openbsd, aix, palmos, qnx, amiga,
|
irix, netbsd, freebsd, openbsd, aix, palmos, qnx, amiga,
|
||||||
atari, netware, macos, macosx, haiku, android, js,
|
atari, netware, macos, macosx, haiku, android, js, standalone, nintendoswitch
|
||||||
standalone, nintendoswitch
|
|
||||||
|
|
||||||
const
|
const
|
||||||
targetOS* = when defined(windows): OsPlatform.windows
|
targetOS* = when defined(windows): OsPlatform.windows
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue