Skip to content

Commit 75302ae

Browse files
colinfangtkelman
authored andcommitted
Add test for issue #15703, bounds error for NTuple (#20151)
1 parent 08adcd3 commit 75302ae

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/tuple.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,28 @@ end
178178
@test_throws BoundsError (1,2,3)[falses(2)]
179179
@test_throws BoundsError ()[[false]]
180180
@test_throws BoundsError ()[[true]]
181+
182+
# issue #15703
183+
let
184+
immutable A_15703{N}
185+
keys::NTuple{N, Int}
186+
end
187+
188+
immutable B_15703
189+
x::A_15703
190+
end
191+
192+
function bug_15703(xs...)
193+
[x for x in xs]
194+
end
195+
196+
function test_15703()
197+
s = (1,)
198+
a = A_15703(s)
199+
ss = B_15703(a).x.keys
200+
@test ss === s
201+
bug_15703(ss...)
202+
end
203+
204+
test_15703()
205+
end

0 commit comments

Comments
 (0)