diff options
Diffstat (limited to 'compiler/semtypinst.nim')
-rwxr-xr-x | compiler/semtypinst.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0c44205de..bfd706bea 100755 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -17,8 +17,10 @@ proc checkPartialConstructedType(info: TLineInfo, t: PType) = elif t.kind == tyVar and t.sons[0].kind == tyVar: LocalError(info, errVarVarTypeNotAllowed) -proc checkConstructedType*(info: TLineInfo, t: PType) = - if tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: +proc checkConstructedType*(info: TLineInfo, typ: PType) = + var t = typ.skipTypes({tyDistinct}) + if t.kind in {tyTypeClass}: nil + elif tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: LocalError(info, errInvalidPragmaX, "acyclic") elif t.kind == tyVar and t.sons[0].kind == tyVar: LocalError(info, errVarVarTypeNotAllowed) |