And this works perfectly well too indeed, 
render{T<:AbstractString}(p::Dict{T})

I didn't realize the type of the value can be omitted, pretty cool! 


joi, 7 iulie 2016, 19:01:55 UTC+2, Adrian Salceanu a scris:
>
> Thanks Steven, 
>
> It works perfectly fine like this: 
>
> julia> function foo{T<:AbstractString, U<:Any}(p::Dict{T, U})
>        @show p
>        end
> foo (generic function with 2 methods)
>
> julia> foo(Dict("abc" => 123))
> p = Dict("abc"=>123)
> Dict{ASCIIString,Int64} with 1 entry:
>   "abc" => 123
>
> Still puzzled as to why the code has worked before and still works on 
> linux, but as long as this works I'm happy with it. Cheers!
>
> joi, 7 iulie 2016, 18:36:57 UTC+2, Steven G. Johnson a scris:
>>
>> You want
>>
>> render{T<:AbstractString}(p::Dict{T})
>>
>> See the bit about "invariant" types in 
>> http://docs.julialang.org/en/latest/manual/types/#parametric-composite-types
>>
>

Reply via email to