summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xcompiler/sigmatch.nim7
-rwxr-xr-xlib/system.nim8
2 files changed, 4 insertions, 11 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index d5b8f3204..a6c5092b8 100755
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -33,7 +33,6 @@ type
   
   TTypeRelation* = enum      # order is important!
     isNone, isConvertible, isIntConv, isSubtype, 
-    isLifted, # match, but do not change argument type to formal's type!
     isGeneric, 
     isEqual
 
@@ -185,9 +184,6 @@ proc tupleRel(mapping: var TIdTable, f, a: PType): TTypeRelation =
         var x = f.n.sons[i].sym
         var y = a.n.sons[i].sym
         if x.name.id != y.name.id: return isNone
-  elif sonsLen(f) == 0:
-    idTablePut(mapping, f, a)
-    result = isLifted
 
 proc constraintRel(mapping: var TIdTable, f, a: PType): TTypeRelation = 
   result = isNone
@@ -493,9 +489,6 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, a: PType,
   of isSubtype: 
     inc(m.subtypeMatches)
     result = implicitConv(nkHiddenSubConv, f, copyTree(arg), m, c)
-  of isLifted:
-    inc(m.genericMatches)
-    result = copyTree(arg)
   of isGeneric: 
     inc(m.genericMatches)
     result = copyTree(arg)
diff --git a/lib/system.nim b/lib/system.nim
index fb43930be..a18412790 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1229,21 +1229,21 @@ proc each*[T](data: var openArray[T], op: proc (x: var T)) =
   ## `op` to every item in `data`.
   for i in 0..data.len-1: op(data[i])
 
-iterator fields*(x: tuple[]): expr {.magic: "Fields", noSideEffect.}
+iterator fields*[T: tuple](x: T): expr {.magic: "Fields", noSideEffect.}
   ## iterates over every field of `x`. Warning: This is really transforms
   ## the 'for' and unrolls the loop. The current implementation also has a bug
   ## that affects symbol binding in the loop body.
-iterator fields*(x, y: tuple[]): tuple[a, b: expr] {.
+iterator fields*[S: tuple, T: tuple](x: S, y: T): tuple[a, b: expr] {.
   magic: "Fields", noSideEffect.}
   ## iterates over every field of `x` and `y`.
   ## Warning: This is really transforms the 'for' and unrolls the loop. 
   ## The current implementation also has a bug that affects symbol binding
   ## in the loop body.
-iterator fieldPairs*(x: tuple[]): expr {.magic: "FieldPairs", noSideEffect.}
+iterator fieldPairs*[T: tuple](x: T): expr {.magic: "FieldPairs", noSideEffect.}
   ## iterates over every field of `x`. Warning: This is really transforms
   ## the 'for' and unrolls the loop. The current implementation also has a bug
   ## that affects symbol binding in the loop body.
-iterator fieldPairs*(x, y: tuple[]): tuple[a, b: expr] {.
+iterator fieldPairs*[S: tuple, T: tuple](x: S, y: T): tuple[a, b: expr] {.
   magic: "FieldPairs", noSideEffect.}
   ## iterates over every field of `x` and `y`.
   ## Warning: This is really transforms the 'for' and unrolls the loop.