Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type satisfies parameter constraints but throws TypeError #30354

Closed
jrevels opened this issue Dec 11, 2018 · 2 comments
Closed

type satisfies parameter constraints but throws TypeError #30354

jrevels opened this issue Dec 11, 2018 · 2 comments

Comments

@jrevels
Copy link
Member

jrevels commented Dec 11, 2018

julia> versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-08 20:11 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin17.5.0)
  CPU: Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

julia> struct Foo{A<:Number,B<:Union{Nothing,Vector{A}}} end

julia> const Bar{B,A} = Foo{A,B}
Foo{A,B} where A where B

julia> Bar{Vector{Int},Int} # this should probably be made to work
ERROR: TypeError: in Foo, in B, expected B<:Union{Nothing, Array{A<:Number,1}}, got Type{Array{Int64,1}}
Stacktrace:
 [1] top-level scope at none:0

ref #29848, #24179, #9441, #6383

@JeffBezanson
Copy link
Member

Seems fixed on master, I believe by #29986.

@jrevels
Copy link
Member Author

jrevels commented Dec 11, 2018

Ah, yup! Awesome, thanks!

@jrevels jrevels closed this as completed Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants