summary refs log tree commit diff stats
path: root/tests/fields/tfieldindex.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fields/tfieldindex.nim')
-rw-r--r--tests/fields/tfieldindex.nim21
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/fields/tfieldindex.nim b/tests/fields/tfieldindex.nim
deleted file mode 100644
index d11c1a8b2..000000000
--- a/tests/fields/tfieldindex.nim
+++ /dev/null
@@ -1,21 +0,0 @@
-discard """
-  output: "1"
-"""
-
-type
-  TMyTuple = tuple[a, b: int]
-
-proc indexOf*(t: typedesc, name: string): int =
-  ## takes a tuple and looks for the field by name.
-  ## returs index of that field.
-  var
-    d: t
-    i = 0
-  for n, x in fieldPairs(d):
-    if n == name: return i
-    i.inc
-  raise newException(EInvalidValue, "No field " & name & " in type " &
-    astToStr(t))
-
-echo TMyTuple.indexOf("b")
-