summary refs log tree commit diff stats
path: root/compiler/suggest.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2023-12-17 18:43:52 +0100
committerGitHub <noreply@github.com>2023-12-17 18:43:52 +0100
commitfe18ec5dc089831c6ea634ade211d8d0dadfec86 (patch)
treebba4a9600c3c53face21ad6cdec45be54f01ca65 /compiler/suggest.nim
parent9b08abaa0574c32f414c09bb4ef183739003884d (diff)
downloadNim-fe18ec5dc089831c6ea634ade211d8d0dadfec86.tar.gz
types refactoring; WIP (#23086)
Diffstat (limited to 'compiler/suggest.nim')
-rw-r--r--compiler/suggest.nim4
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