summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/semstmts.nim2
-rwxr-xr-xcompiler/semtypes.nim6
-rwxr-xr-xcompiler/sigmatch.nim3
3 files changed, 8 insertions, 3 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 64b0f5339..d8336fc94 100755
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -802,7 +802,7 @@ proc evalInclude(c: PContext, n: PNode): PNode =
     var f = checkModuleName(n.sons[i])
     var fileIndex = f.fileInfoIdx
     if ContainsOrIncl(c.includedFiles, fileIndex): 
-      GlobalError(n.info, errRecursiveDependencyX, f)
+      GlobalError(n.info, errRecursiveDependencyX, f.shortenDir)
     addSon(result, semStmt(c, gIncludeFile(f)))
     Excl(c.includedFiles, fileIndex)
   
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 78a95c56b..b71f230eb 100755
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -781,7 +781,11 @@ proc semGenericConstraints(c: PContext, n: PNode, result: PType) =
     semGenericConstraints(c, n.sons[1], result)
     semGenericConstraints(c, n.sons[2], result)
   else:
-    result.addSon(semTypeNode(c, n, nil))
+    var x = semTypeNode(c, n, nil)
+    if x.kind in StructuralEquivTypes and sonsLen(x) == 0:
+      x = newConstraint(c, x.kind)
+      #echo "came here for: ", typeToString(x)
+    result.addSon(x)
 
 proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = 
   result = copyNode(n)
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index a6bde6e40..9a8f3cee1 100755
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -388,7 +388,8 @@ proc typeRel(mapping: var TIdTable, f, a: PType): TTypeRelation =
   of tyGenericInst: 
     result = typeRel(mapping, lastSon(f), a)
   of tyGenericBody: 
-    result = typeRel(mapping, lastSon(f), a)
+    let ff = lastSon(f)
+    if ff != nil: result = typeRel(mapping, ff, a)
   of tyGenericInvokation: 
     assert(f.sons[0].kind == tyGenericBody)
     if a.kind == tyGenericInvokation: