Skip to content

Commit c1ac4c0

Browse files
committed
switched inferred checks for prevnext to index into results rather than allow supertype of result
1 parent 2ce4f40 commit c1ac4c0

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

test/runtests.jl

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,8 @@ const BT = BinaryTrees
242242
@inferred BT.insert!(tree, 3, 30)
243243
@inferred Nothing BT.minnode(tree)
244244
@inferred Nothing BT.maxnode(tree)
245-
@inferred Tuple{Union{BT.AVLNode,Nothing},Union{BT.AVLNode,Nothing}} BT.prevnext(
246-
tree,
247-
2
248-
)
245+
@inferred Nothing BT.prevnext(tree, 2)[1]
246+
@inferred Nothing BT.prevnext(tree, 2)[2]
249247
@inferred BT.prevnext(tree, nothing)
250248
@inferred Nothing BT.search(tree, 2)
251249
@inferred Nothing BT.search(tree, 1)
@@ -259,10 +257,10 @@ const BT = BinaryTrees
259257
@inferred BT.insert!(tree, 3)
260258
@inferred Nothing BT.minnode(tree)
261259
@inferred Nothing BT.maxnode(tree)
262-
@inferred Tuple{Union{BT.AVLNode,Nothing},Union{BT.AVLNode,Nothing}} BT.prevnext(
263-
tree,
264-
2
265-
)
260+
@inferred Nothing BT.prevnext(tree, 2)[1]
261+
@inferred Nothing BT.prevnext(tree, 2)[2]
262+
@inferred BT.prevnext(tree, nothing)
263+
@inferred Nothing BT.search(tree, 2)
266264
@inferred Nothing BT.search(tree, 2)
267265
@inferred Nothing BT.search(tree, 1)
268266
@inferred Nothing BT.search(tree, 3)
@@ -275,10 +273,9 @@ const BT = BinaryTrees
275273
@inferred BT.insert!(tree, "key3", 3)
276274
@inferred Nothing BT.minnode(tree)
277275
@inferred Nothing BT.maxnode(tree)
278-
@inferred Tuple{Union{BT.AVLNode,Nothing},Union{BT.AVLNode,Nothing}} BT.prevnext(
279-
tree,
280-
"key2"
281-
)
276+
@inferred Nothing BT.prevnext(tree, "key2")[1]
277+
@inferred Nothing BT.prevnext(tree, "key2")[2]
278+
@inferred BT.prevnext(tree, nothing)
282279
@inferred Nothing BT.search(tree, "key2")
283280
@inferred Nothing BT.search(tree, "key1")
284281
@inferred Nothing BT.search(tree, "key3")
@@ -291,10 +288,9 @@ const BT = BinaryTrees
291288
@inferred BT.insert!(tree, (1, 0, 0), 3)
292289
@inferred Nothing BT.minnode(tree)
293290
@inferred Nothing BT.maxnode(tree)
294-
@inferred Tuple{Union{BT.AVLNode,Nothing},Union{BT.AVLNode,Nothing}} BT.prevnext(
295-
tree,
296-
(0, 1, 0)
297-
)
291+
@inferred Nothing BT.prevnext(tree, (0, 1, 0))[1]
292+
@inferred Nothing BT.prevnext(tree, (0, 1, 0))[2]
293+
@inferred BT.prevnext(tree, nothing)
298294
@inferred Nothing BT.search(tree, (0, 1, 0))
299295
@inferred Nothing BT.search(tree, (0, 0, 1))
300296
@inferred Nothing BT.search(tree, (1, 0, 0))

0 commit comments

Comments
 (0)