summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-12-31 10:23:56 +0100
committerAraq <rumpf_a@web.de>2011-12-31 10:23:56 +0100
commitd25fefc0ff05ebf38b09809edfb8ef3a3ae6c8a2 (patch)
tree01b551a36ba3c4913ed2f01bd4d30b89f6d9c188
parent9fdfda136c4d3ec0d8e72867345b427b30e88ef4 (diff)
downloadNim-d25fefc0ff05ebf38b09809edfb8ef3a3ae6c8a2.tar.gz
make trecinca|b tests green
-rwxr-xr-xcompiler/semstmts.nim2
-rwxr-xr-xcompiler/semtypes.nim6
-rwxr-xr-xcompiler/sigmatch.nim3
-rwxr-xr-xlib/system.nim2
-rwxr-xr-xtests/reject/trecinca.nim2
-rwxr-xr-xtests/reject/trecincb.nim2
6 files changed, 11 insertions, 6 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: 
diff --git a/lib/system.nim b/lib/system.nim
index f8bfe3e77..0418e220e 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -309,7 +309,7 @@ proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.}
   ## This is equivalent to ``s = @[]; setlen(s, len)``, but more
   ## efficient since no reallocation is needed.
 
-proc len*[T](x: openarray[T]): int {.magic: "LengthOpenArray", noSideEffect.}
+proc len*[T](x: openArray[T]): int {.magic: "LengthOpenArray", noSideEffect.}
 proc len*(x: string): int {.magic: "LengthStr", noSideEffect.}
 proc len*(x: cstring): int {.magic: "LengthStr", noSideEffect.}
 proc len*[I, T](x: array[I, T]): int {.magic: "LengthArray", noSideEffect.}
diff --git a/tests/reject/trecinca.nim b/tests/reject/trecinca.nim
index 27f982e66..99750beb9 100755
--- a/tests/reject/trecinca.nim
+++ b/tests/reject/trecinca.nim
@@ -1,7 +1,7 @@
 discard """
   file: "trecincb.nim"
   line: 9
-  errormsg: "recursive dependency: '/home/nimrod/Nimrod/tests/reject/trecincb.nim'"
+  errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
 """
 # Test recursive includes
 
diff --git a/tests/reject/trecincb.nim b/tests/reject/trecincb.nim
index 55be2ac88..9dd7d51de 100755
--- a/tests/reject/trecincb.nim
+++ b/tests/reject/trecincb.nim
@@ -1,7 +1,7 @@
 discard """
   file: "trecincb.nim"
   line: 9
-  errormsg: "recursive dependency: '/home/nimrod/Nimrod/tests/reject/trecincb.nim'"
+  errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
 """
 # Test recursive includes