Skip to content

Commit

Permalink
fix constructor for types
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Apr 28, 2017
1 parent 7ec2c24 commit 1dd9f38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
4 changes: 3 additions & 1 deletion test/basics.jl
Expand Up @@ -8,7 +8,9 @@ number() = round(Int, rand()*1000)
## Basics

facts("Basic checks") do

x = Signal(Float32)
@test isa(x, Signal{Type{Float32}})

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

Expand Down

0 comments on commit 1dd9f38

Please sign in to comment.