Skip to content

Commit

Permalink
The careful art of type-instability
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Aug 18, 2023
1 parent b29e0fe commit 27ae621
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions base/scopedvalues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ import Base: ImmutableDict
# - Scopes are an inline implementation of an ImmutableDict, if we wanted
# be really fance we could use a CTrie or HAMT.

mutable struct Scope{T}
mutable struct Scope
const parent::Union{Nothing, Scope}
const key::ScopedValue{T}
const value::T
const key::ScopedValue
const value::Any
Scope(parent, key::ScopedValue{T}, value::T) where T = new(parent, key, value)
end
Scope(parent, key::ScopedValue{T}, value) where T =
Scope(parent, key, convert(T, value))
Expand Down

0 comments on commit 27ae621

Please sign in to comment.