Skip to content

Commit

Permalink
close nim-lang#3899 by adding test case (nim-lang#10424)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar authored and ThomasTJdev committed Jan 27, 2019
1 parent 0b378a6 commit eefebab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/array/tarray.nim
Expand Up @@ -27,6 +27,7 @@ dflfdjkl__abcdefgasfsgdfgsgdfggsdfasdfsafewfkljdsfajs
dflfdjkl__abcdefgasfsgdfgsgdfggsdfasdfsafewfkljdsfajsdf
kgdchlfniambejop
fjpmholcibdgeakn
2.0
'''
joinable: false
"""
Expand Down Expand Up @@ -538,3 +539,12 @@ block trelaxedindextyp:
proc foo(x: seq[int]; idx: uint64) = echo x[idx]
proc foo(x: string|cstring; idx: uint64) = echo x[idx]
proc foo(x: openArray[int]; idx: uint64) = echo x[idx]

block t3899:
# https://github.com/nim-lang/Nim/issues/3899
type O = object
a: array[1..2,float]
template `[]`(x: O, i: int): float =
x.a[i]
const c = O(a: [1.0,2.0])
echo c[2]

0 comments on commit eefebab

Please sign in to comment.