Skip to content

Commit

Permalink
Merge pull request #231 from plotly/adapt-for-1.10
Browse files Browse the repository at this point in the history
Fix `convert([v], v)` dispatch for Julia 1.10
  • Loading branch information
etpinard authored Dec 28, 2023
2 parents 8b332be + 9cd4a87 commit 471b748
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jl_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jl_version: ["1.6", "1.8", "1.9"]
jl_version: ["1.6", "1.8", "1.9", "1.10"]
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
8 changes: 6 additions & 2 deletions src/app/supporttypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ struct TraitInput end
struct TraitOutput end
struct TraitState end

struct Dependency{Trait, IdT <: Union{String, NamedTuple}}
const IdTypes = Union{String,NamedTuple}

struct Dependency{Trait, IdT<:IdTypes}
id ::IdT
property ::String
Dependency{Trait}(id::T, property::String) where {Trait, T} = new{Trait, T}(id, property)
Expand Down Expand Up @@ -95,7 +97,9 @@ struct CallbackDeps
CallbackDeps(output::Vector{<:Output}, input, state = State[]) = new(output, input, state, true)
end

Base.convert(::Type{Vector{<:T}}, v::T) where {T<:Dependency} = [v]
Base.convert(::Type{Vector{<:Output}}, v::Output{<:IdTypes}) = [v]
Base.convert(::Type{Vector{<:Input}}, v::Input{<:IdTypes}) = [v]
Base.convert(::Type{Vector{<:State}}, v::State{<:IdTypes}) = [v]

struct ClientsideFunction
namespace ::String
Expand Down

0 comments on commit 471b748

Please sign in to comment.