Skip to content

Commit

Permalink
Merge pull request #136 from JuliaGizmos/sd/construcor
Browse files Browse the repository at this point in the history
fix constructor for types
  • Loading branch information
SimonDanisch committed Apr 28, 2017
2 parents 7ec2c24 + 50db67c commit 9696f27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.jl
Expand Up @@ -76,7 +76,7 @@ isrequired(a::Action) = (a.recipient.value != nothing) && a.recipient.value.aliv
Signal{T}(x::T, parents=(); name::String=auto_name!("input")) = Signal{T}(x, parents, Action[], true, Dict{Signal, Int}(), name)
Signal{T}(::Type{T}, x, parents=(); name::String=auto_name!("input")) = Signal{T}(x, parents, Action[], true, Dict{Signal, Int}(), name)
# A signal of types
Signal(t::Type; name::String = auto_name!("input")) = Signal(Type, t, name)
Signal{T}(t::Type{T}; name::String = auto_name!("input")) = Signal(Type{T}, t, name = name)

# preserve/unpreserve nodes from gc
"""
Expand Down
2 changes: 2 additions & 0 deletions test/basics.jl
Expand Up @@ -8,6 +8,8 @@ number() = round(Int, rand()*1000)
## Basics

facts("Basic checks") do
x = Signal(Float32)
@fact isa(x, Signal{Type{Float32}}) --> true

a = Signal(number())
b = map(x -> x*x, a)
Expand Down

0 comments on commit 9696f27

Please sign in to comment.