Skip to content

Commit b26f10e

Browse files
committed
Tidy up context methods
1 parent 20de15a commit b26f10e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/contexts.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,17 @@ DynamicTransformationContext{true}()
6161
setchildcontext
6262

6363
"""
64-
leafcontext(context)
64+
leafcontext(context::AbstractContext)
6565
6666
Return the leaf of `context`, i.e. the first descendant context that `IsLeaf`.
6767
"""
68-
leafcontext(context) = leafcontext(NodeTrait(leafcontext, context), context)
68+
leafcontext(context::AbstractContext) =
69+
leafcontext(NodeTrait(leafcontext, context), context)
6970
leafcontext(::IsLeaf, context) = context
7071
leafcontext(::IsParent, context) = leafcontext(childcontext(context))
7172

7273
"""
73-
setleafcontext(left, right)
74+
setleafcontext(left::AbstractContext, right::AbstractContext)
7475
7576
Return `left` but now with its leaf context replaced by `right`.
7677
@@ -106,7 +107,7 @@ julia> # Append another parent context.
106107
ParentContext(ParentContext(ParentContext(DefaultContext())))
107108
```
108109
"""
109-
function setleafcontext(left, right)
110+
function setleafcontext(left::AbstractContext, right::AbstractContext)
110111
return setleafcontext(
111112
NodeTrait(setleafcontext, left), NodeTrait(setleafcontext, right), left, right
112113
)

0 commit comments

Comments
 (0)