diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2023-12-17 18:43:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 18:43:52 +0100 |
commit | fe18ec5dc089831c6ea634ade211d8d0dadfec86 (patch) | |
tree | bba4a9600c3c53face21ad6cdec45be54f01ca65 /compiler/suggest.nim | |
parent | 9b08abaa0574c32f414c09bb4ef183739003884d (diff) | |
download | Nim-fe18ec5dc089831c6ea634ade211d8d0dadfec86.tar.gz |
types refactoring; WIP (#23086)
Diffstat (limited to 'compiler/suggest.nim')
-rw-r--r-- | compiler/suggest.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 9e0fc13e4..5eb2c03ab 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -337,7 +337,7 @@ proc fieldVisible*(c: PContext, f: PSym): bool {.inline.} = proc getQuality(s: PSym): range[0..100] = result = 100 - if s.typ != nil and s.typ.len > 1: + if s.typ != nil and s.typ.paramsLen > 0: var exp = s.typ.firstParamType.skipTypes({tyGenericInst, tyVar, tyLent, tyAlias, tySink}) if exp.kind == tyVarargs: exp = elemType(exp) if exp.kind in {tyUntyped, tyTyped, tyGenericParam, tyAnything}: result = 50 @@ -407,7 +407,7 @@ proc suggestVar(c: PContext, n: PNode, outputs: var Suggestions) = wholeSymTab(nameFits(c, it, n), ideCon) proc typeFits(c: PContext, s: PSym, firstArg: PType): bool {.inline.} = - if s.typ != nil and s.typ.len > 1 and s.typ.firstParamType != nil: + if s.typ != nil and s.typ.paramsLen > 0 and s.typ.firstParamType != nil: # special rule: if system and some weird generic match via 'tyUntyped' # or 'tyGenericParam' we won't list it either to reduce the noise (nobody # wants 'system.`-|` as suggestion |