type with same name in different scope now works (#17710)
* type with same name in different scope now works * fix tests/enum/tenum.nim which was wrong because it was affected by this bug
This commit is contained in:
parent
fe77c3c72f
commit
840e13deb7
4 changed files with 133 additions and 9 deletions
|
|
@ -1354,8 +1354,11 @@ proc typeSectionFinalPass(c: PContext, n: PNode) =
|
|||
checkConstructedType(c.config, s.info, s.typ)
|
||||
if s.typ.kind in {tyObject, tyTuple} and not s.typ.n.isNil:
|
||||
checkForMetaFields(c, s.typ.n)
|
||||
# fix bug #5170: ensure locally scoped object types get a unique name:
|
||||
if s.typ.kind == tyObject and not isTopLevel(c): incl(s.flags, sfGenSym)
|
||||
|
||||
# fix bug #5170, bug #17162, bug #15526: ensure locally scoped types get a unique name:
|
||||
if s.typ.kind in {tyEnum, tyRef, tyObject} and not isTopLevel(c):
|
||||
incl(s.flags, sfGenSym)
|
||||
|
||||
#instAllTypeBoundOp(c, n.info)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue