I’m not sure if this is a bug or not but methodswith doesn’t seem to work 
on Union types.
I came across this working with a linear fit in the GLM package

using GLM, DataFrames
lmfit = lm(y ~ x, DataFrame(x=[1,2,3], y=[2,3,3]))
methodswith(typeof(lmfit))

Here is a minimal working example

julia> type Type1
           x
       end

julia> type Type2
           x
           y
       end

julia> foo(t::Union(Type1, Type2)) = t.x
foo (generic function with 1 method)

julia> foo(Type1(10))
10

julia> methodswith(Type1)
0-element Array{Method,1}

Here is my version info

julia> versioninfo()
Julia Version 0.3.4-pre+2
Commit 9f76ed3 (2014-11-24 17:47 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin14.0.0)
  CPU: Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

​

Reply via email to