Skip to content

Commit

Permalink
fix docs bug and weird code
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 23, 2023
1 parent 3b09ae2 commit 4b7d975
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind, docFlags: DocFlags, nonEx

var attype = ""
if k in routineKinds and symNameNode.kind == nkSym:
let att = attachToType(d, nameNode.sym)
let att = attachToType(d, symNameNode.sym)
if att != nil:
attype = esc(d.target, att.name.s)
elif k == skType and symNameNode.kind == nkSym and
Expand Down
6 changes: 4 additions & 2 deletions compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1538,8 +1538,10 @@ proc trySemObjectTypeForInheritedGenericInst(c: PContext, n: PNode, t: PType): b
proc containsGenericInvocationWithForward(n: PNode): bool =
if n.kind == nkSym and n.sym.ast != nil and n.sym.ast.len > 1 and n.sym.ast[2].kind == nkObjectTy:
for p in n.sym.ast[2][^1]:
if p.kind == nkIdentDefs and p[1].typ != nil and p[1].typ.kind == tyGenericInvocation and
p[1][0].kind == nkSym and p[1][0].typ.kind == tyForward:
if p.kind == nkIdentDefs:
let pTyp = p[^2]
if pTyp.typ != nil and pTyp.typ.kind == tyGenericInvocation and
pTyp.kind == nkBracketExpr and pTyp[0].kind == nkSym and pTyp[0].typ.kind == tyForward:
return true
return false

Expand Down

0 comments on commit 4b7d975

Please sign in to comment.