From 1144ce89ffb1f0f028e2acc9b3734c3f0801190a Mon Sep 17 00:00:00 2001 From: bung87 Date: Tue, 17 Oct 2023 03:03:34 +0800 Subject: [PATCH] remove `hasUnresolvedParams` disabled code and obsolete `flags: TExprFlags` parameter --- compiler/sem/semexprs.nim | 2 +- compiler/sem/semstmts.nim | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/compiler/sem/semexprs.nim b/compiler/sem/semexprs.nim index 2ab69326944..9a70a1d331f 100644 --- a/compiler/sem/semexprs.nim +++ b/compiler/sem/semexprs.nim @@ -52,7 +52,7 @@ proc semOperand(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = if result.typ != nil: # XXX tyGenericInst here? - if result.typ.kind == tyProc and hasUnresolvedParams(result, {efOperand}): + if result.typ.kind == tyProc and hasUnresolvedParams(result): result = c.config.newError(n, PAstDiag(kind: adSemProcHasNoConcreteType)) elif result.typ.kind in {tyVar, tyLent}: result = newDeref(result) diff --git a/compiler/sem/semstmts.nim b/compiler/sem/semstmts.nim index f58e8b2beaa..0c89960d1cd 100644 --- a/compiler/sem/semstmts.nim +++ b/compiler/sem/semstmts.nim @@ -444,22 +444,8 @@ proc hasEmpty(typ: PType): bool = for s in typ.sons: result = result or hasEmpty(s) -proc hasUnresolvedParams(n: PNode; flags: TExprFlags): bool = +proc hasUnresolvedParams(n: PNode): bool = result = tfUnresolved in n.typ.flags - when false: - case n.kind - of nkSym: - result = isGenericRoutineStrict(n.sym) - of nkSymChoices: - for ch in n: - if hasUnresolvedParams(ch, flags): - return true - result = false - else: - result = false - if efOperand in flags: - if tfUnresolved notin n.typ.flags: - result = false proc makeDeref(n: PNode): PNode = var t = n.typ