mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
fixes #25419
(cherry picked from commit 40480fe348)
This commit is contained in:
@@ -617,7 +617,7 @@ proc checkDefineType(c: PContext; v: PSym; t: PType) =
|
||||
# no distinct types for generic define
|
||||
skipped.excl tyDistinct
|
||||
if t.skipTypes(skipped).kind notin typeKinds:
|
||||
let name =
|
||||
let name =
|
||||
case v.magic
|
||||
of mStrDefine: "strdefine"
|
||||
of mIntDefine: "intdefine"
|
||||
@@ -1829,6 +1829,13 @@ proc typeSectionFinalPass(c: PContext, n: PNode) =
|
||||
x[0].kind in {nkObjectTy, nkTupleTy})
|
||||
):
|
||||
checkForMetaFields(c, baseType.n, hasError)
|
||||
|
||||
if s.typ.kind in {tySet, tyArray, tySequence, tyUncheckedArray} and s.typ.elementType.kind == tyNone:
|
||||
# magic generics are not filled but tyNone is added to its elements by default,
|
||||
# we lift them to tyBuiltInTypeClass here
|
||||
s.typ = newTypeS(tyBuiltInTypeClass, c,
|
||||
newTypeS(s.typ.kind, c))
|
||||
|
||||
if not hasError:
|
||||
checkConstructedType(c.config, s.info, s.typ)
|
||||
#instAllTypeBoundOp(c, n.info)
|
||||
@@ -2640,7 +2647,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
||||
# we need to add a result symbol for them
|
||||
maybeAddResult(c, s, n)
|
||||
|
||||
|
||||
|
||||
trackProc(c, s, s.ast[bodyPos])
|
||||
else:
|
||||
if (s.typ.returnType != nil and s.kind != skIterator):
|
||||
|
||||
Reference in New Issue
Block a user