diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index c6ed5e77dc..ede1c819e4 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -2049,7 +2049,8 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = # proc signature for example if c.inGenericInst > 0: let bound = result.typ.elementType.sym - if bound != nil: return bound + if bound != nil and bound.typ == result.typ.elementType: + return bound return result if result.typ.sym == nil: localError(c.config, n.info, errTypeExpected)