summary refs log tree commit diff stats
path: root/tests/array/troof4.nim
diff options
context:
space:
mode:
authorDaniil Yarancev <21169548+Yardanico@users.noreply.github.com>2018-01-07 21:02:00 +0300
committerGitHub <noreply@github.com>2018-01-07 21:02:00 +0300
commitfb44c522e6173528efa8035ecc459c84887d0167 (patch)
treea2f5e98606be265981a5f72748896967033e23d7 /tests/array/troof4.nim
parentccf99fa5ce4fe992fb80dc89271faa51456c3fa5 (diff)
parente23ea64c41e101d4e1d933f0b015f51cc6c2f7de (diff)
downloadNim-fb44c522e6173528efa8035ecc459c84887d0167.tar.gz
Merge pull request #1 from nim-lang/devel
upstream
Diffstat (limited to 'tests/array/troof4.nim')
-rw-r--r--tests/array/troof4.nim37
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/array/troof4.nim b/tests/array/troof4.nim
deleted file mode 100644
index 7a262d9de..000000000
--- a/tests/array/troof4.nim
+++ /dev/null
@@ -1,37 +0,0 @@
-discard """
-  errormsg: "no surrounding array access context for '^'"
-  line: "37"
-"""
-
-proc foo[T](x, y: T): T = x
-
-var a = @[1, 2, 3, 4]
-var b: array[3, array[2, float]] = [[1.0,2], [3.0,4], [8.0,9]]
-echo a[1.. ^1], a[^2], a[^3], a[^4]
-echo b[^1][^1], " ", (b[^2]).foo(b[^1])[^1]
-
-type
-  MyArray = object
-    a, b, c: float
-
-var
-  ma = MyArray(a: 1.0, b: 2.0, c: 3.0)
-
-proc len(x: MyArray): int = 3
-
-proc `[]=`(x: var MyArray; idx: range[0..2]; val: float) =
-  case idx
-  of 0: x.a = val
-  of 1: x.b = val
-  of 2: x.c = val
-
-proc `[]`(x: var MyArray; idx: range[0..2]): float =
-  case idx
-  of 0: result = x.a
-  of 1: result = x.b
-  of 2: result = x.c
-
-ma[^1] = 8.0
-echo ma, ma[^2]
-
-echo(^1)