Hi, I'm trying to write something that makes a type alias of Dict{PhyNode, 
T}, and then use that type alias in a composite type "TreeAnnotations{T}" 
as in the code below.

However Julia tells me about the TreeAnnotations{T}(x::Phylogeny) function:

Warning: static parameter T does not occur in signature for call at none:9.

The method will not be callable.


I'm not sure why - probably being dumb - but I can't tell what the issue 
is, you have to do NodeAnnotations{String}() say to make a Dict{PhyNode, 
String}


So I don't see why using T as I have is a problem.
Thanks,
Ben.

typealias NodeAnnotations{T} Dict{PhyNode, T}


type TreeAnnotations{T}
  x::Phylogeny
  annotations::NodeAnnotations{T}
end


function TreeAnnotations{T}(x::Phylogeny)
  return TreeAnnotations(x, NodeAnnotations{T}())
end


function Base.getindex{T}(x::TreeAnnotations{T}, index::PhyNode)
  return x.annotations[index]
end


function Base.setindex!{T}(x::TreeAnnotations{T}, item::T, clade::PhyNode)
  x.annotations[clade] = item
end



Reply via email to