Generic pointer procs now error if no types supplied (#18832)
* more precise logic for pointer procs * added test for generic pointer procs * Fixed generic getting bracket expr if erroring
This commit is contained in:
parent
66e53bdd7b
commit
5d1608c976
3 changed files with 30 additions and 2 deletions
|
|
@ -1511,7 +1511,7 @@ proc maybeInstantiateGeneric(c: PContext, n: PNode, s: PSym): PNode =
|
|||
else:
|
||||
result = explicitGenericInstantiation(c, n, s)
|
||||
if result == n:
|
||||
n[0] = copyTree(result)
|
||||
n[0] = copyTree(result[0])
|
||||
else:
|
||||
n[0] = result
|
||||
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
|
|||
typ = typ.lastSon
|
||||
if hasEmpty(typ):
|
||||
localError(c.config, def.info, errCannotInferTypeOfTheLiteral % typ.kind.toHumanStr)
|
||||
elif typ.kind == tyProc and hasUnresolvedParams(def, {}):
|
||||
elif typ.kind == tyProc and def.kind == nkSym and isGenericRoutine(def.sym.ast):
|
||||
# tfUnresolved in typ.flags:
|
||||
localError(c.config, def.info, errProcHasNoConcreteType % def.renderTree)
|
||||
when false:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue