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

0.5: error in type inference due to #265 #17932

Closed
dlfivefifty opened this issue Aug 10, 2016 · 11 comments
Closed

0.5: error in type inference due to #265 #17932

dlfivefifty opened this issue Aug 10, 2016 · 11 comments
Labels
compiler:inference Type inference error handling Handling of exceptions by Julia or the user

Comments

@dlfivefifty
Copy link
Contributor

I get the following error. I couldn't find an open issue #265, so I'm not sure what it's referring too.

If the issue isn't already known, I can try to make a branch to reproduce it.

Julia Version 0.5.0-rc1+1
Commit acfd04c (2016-08-05 15:23 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libgfortblas
  LAPACK: liblapack
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)


ERROR: LoadError: error in type inference due to #265
 in error(::String) at ./error.jl:21
 in next at ./generator.jl:26 [inlined]
 in copy!(::Array{Int64,1}, ::Base.Generator{Tuple{ApproxFun.Fun{ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},Array{ApproxFun.Fun,1}},Base.##80#82}) at ./abstractarray.jl:394
 in _collect(::Type{Int64}, ::Base.Generator{Tuple{ApproxFun.Fun{ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},Array{ApproxFun.Fun,1}},Base.##80#82}, ::Base.HasLength) at ./array.jl:213
 in cat_t(::Int64, ::Type{T}, ::ApproxFun.Fun{ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64}}, ::Vararg{Any,N}) at ./abstractarray.jl:977
 in vcat(::ApproxFun.Fun{ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64}}, ::Array{ApproxFun.Fun,1}) at ./abstractarray.jl:1020
 in assemble(::Array{ApproxFun.Fun{ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},1}, ::Array{ApproxFun.Fun{ApproxFun.PiecewiseSpace{Tuple{ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},Complex{Float64}},1}) at /Users/solver/.julia/v0.5/SingularIntegralEquations/src/Operators/hierarchicalsolve.jl:211
 in hierarchicalsolve(::SingularIntegralEquations.HierarchicalOperator{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Space{ApproxFun.RealBasis,D,1},ApproxFun.Space{ApproxFun.RealBasis,D,1},Complex{Float64}},Complex{Float64},Tuple{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},SingularIntegralEquations.HierarchicalOperator{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},Complex{Float64},Tuple{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}}},Tuple{SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}}}}},Tuple{SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.PiecewiseSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.PiecewiseSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},Complex{Float64}}}}, ::Array{ApproxFun.Fun{ApproxFun.PiecewiseSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},Float64},1}) at /Users/solver/.julia/v0.5/SingularIntegralEquations/src/Operators/hierarchicalsolve.jl:48
 in \(::SingularIntegralEquations.HierarchicalOperator{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Space{ApproxFun.RealBasis,D,1},ApproxFun.Space{ApproxFun.RealBasis,D,1},Complex{Float64}},Complex{Float64},Tuple{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},SingularIntegralEquations.HierarchicalOperator{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},Complex{Float64},Tuple{ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}},ApproxFun.QROperator{ApproxFun.CachedOperator{Complex{Float64},BandedMatrices.BandedMatrix{Complex{Float64}},ApproxFun.TimesOperator{Complex{Float64},Tuple{Int64,Int64}},ApproxFun.JacobiWeight{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Tuple{Int64,Int64}},Complex{Float64}}},Tuple{SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}}}}},Tuple{SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.PiecewiseSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},Complex{Float64}},SingularIntegralEquations.LowRankIntegralOperator{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.PiecewiseSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},Complex{Float64}}}}, ::ApproxFun.Fun{ApproxFun.PiecewiseSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Complex{Float64}}}},ApproxFun.RealBasis,ApproxFun.UnionDomain{Tuple{ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}},ApproxFun.Interval{Complex{Float64}}},Complex{Float64},1},1},Float64}) at /Users/solver/.julia/v0.5/SingularIntegralEquations/src/Operators/hierarchicalsolve.jl:7
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318
while loading /Users/solver/.julia/v0.4/SingularIntegralEquations/test/hierarchicalsolveTest.jl, in expression starting on line 184
@dlfivefifty
Copy link
Contributor Author

The line number is also off: hierarchicalsolveTest.jl only has 109 lines.

@yuyichao
Copy link
Contributor

I couldn't find an open issue #265

What do you mean?

@dlfivefifty
Copy link
Contributor Author

I mean I don’t know what #265 means in the error message. I thought it might mean “due to issue #265” but I didn’t find such an issue.

On 10 Aug 2016, at 4:12 PM, Yichao Yu notifications@github.com wrote:

I couldn't find an open issue #265 #265
What do you mean?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #17932 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABLDqTbGyM87J5YAz6Uan4gVEDfVySEyks5qeWu4gaJpZM4JgyW0.

@tkelman
Copy link
Contributor

tkelman commented Aug 10, 2016

github.com//issues/265

Also see #17212 (comment) "this is effectively jargon," the error message could be made considerably clearer

@dlfivefifty
Copy link
Contributor Author

I apparently don't know how to search for issues in github...I tried typing #265 in the search box but nothing came up.

I assume this means that a function is being redefined? And I can close this issue?

@yuyichao
Copy link
Contributor

I apparently don't know how to search for issues in github

The #265 you typed is the link itself.

I assume this means that a function is being redefined? And I can close this issue?

Yes.

@dlfivefifty
Copy link
Contributor Author

Is there a reason it can't print the name of the redefined function? It's difficult to debug.

@yuyichao
Copy link
Contributor

Yes, the redefinition can happen at any level.

@JeffBezanson JeffBezanson added the error handling Handling of exceptions by Julia or the user label Aug 10, 2016
@JeffBezanson JeffBezanson reopened this Aug 10, 2016
@JeffBezanson
Copy link
Member

Yes, the error message should improve. The code at that point I think could even say "code invalidated due to new definition of function f for types T".

Or we could potentially fall back to dynamic dispatch plus a type assertion that the type returned by the new code is compatible with what we inferred. Then there's a chance we could keep running without an error.

@kshyatt kshyatt added the compiler:inference Type inference label Aug 10, 2016
JeffBezanson added a commit that referenced this issue Aug 16, 2016
This should help #17932. If a function returns an unanticipated type
that wasn't part of the `Union` seen by inference, do dynamic
dispatch instead of erroring.
tkelman pushed a commit that referenced this issue Aug 22, 2016
This should help #17932. If a function returns an unanticipated type
that wasn't part of the `Union` seen by inference, do dynamic
dispatch instead of erroring.

(cherry picked from commit b0cf591)
ref #18046
tkelman pushed a commit that referenced this issue Aug 22, 2016
This should help #17932. If a function returns an unanticipated type
that wasn't part of the `Union` seen by inference, do dynamic
dispatch instead of erroring.

(cherry picked from commit b0cf591)
ref #18046
tkelman pushed a commit that referenced this issue Aug 22, 2016
This should help #17932. If a function returns an unanticipated type
that wasn't part of the `Union` seen by inference, do dynamic
dispatch instead of erroring.

(cherry picked from commit b0cf591)
ref #18046
@dlfivefifty
Copy link
Contributor Author

The example above is now passing in 0.5.0-rc3. Should we close this?

mfasi pushed a commit to mfasi/julia that referenced this issue Sep 5, 2016
This should help JuliaLang#17932. If a function returns an unanticipated type
that wasn't part of the `Union` seen by inference, do dynamic
dispatch instead of erroring.
@KristofferC
Copy link
Member

#265 is now closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

6 participants