summary refs log tree commit diff stats
path: root/tests/compiles/tevilcompiles.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compiles/tevilcompiles.nim')
-rw-r--r--tests/compiles/tevilcompiles.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/compiles/tevilcompiles.nim b/tests/compiles/tevilcompiles.nim
new file mode 100644
index 000000000..0930507d1
--- /dev/null
+++ b/tests/compiles/tevilcompiles.nim
@@ -0,0 +1,12 @@
+# bug #1055
+import unittest
+type TMatrix*[N,M: static[int], T] = object
+  data*: array[0..N*M-1, T]
+proc `==`*(a: distinct TMatrix; b: distinct TMatrix): bool =
+  result = a.data == b.data
+
+test "c":
+  var a = TMatrix[2,2,int](data: [1,2,3,4])
+  var b = TMatrix[2,2,int](data: [1,2,3,4])
+  check(a == b)
+