summary refs log tree commit diff stats
path: root/compiler/semtypinst.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semtypinst.nim')
-rwxr-xr-xcompiler/semtypinst.nim6
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)