Improve error message when type uses old Tuple format #11278
Labels
bug
Indicates an unexpected problem or unintended behavior
error handling
Handling of exceptions by Julia or the user
I spent days tracking down a bug, which turned out to be due to the (S,V) instead of Tuple{S,V} in a type definition:
immutable KroneckerOperator{S,V,DS,RS,T}<: BivariateOperator{T}
ops::(S,V)
domainspace::DS
rangespace::RS
end
The error message gave no hint that the issue was inside KroneckerOperator: it appeared while trying to compile a function that didn't have anything to do with KroneckerOperator. Here is the error message.
TypeError: subtype: expected Type{T}, got Tuple{TypeVar,TypeVar}
in abstract_call_gf at ./inference.jl:586
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_eval_call at ./inference.jl:881
in abstract_eval at ./inference.jl:931
in abstract_eval_call at ./inference.jl:881
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_eval_call at ./inference.jl:881
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_eval_call at ./inference.jl:881
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_interpret at ./inference.jl:1080
in typeinf_uncached at ./inference.jl:1518
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_call at ./inference.jl:817
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_call at ./inference.jl:817
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_eval_call at ./inference.jl:881
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_interpret at ./inference.jl:1080
in typeinf_uncached at ./inference.jl:1518
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in abstract_interpret at ./inference.jl:1080
in typeinf_uncached at ./inference.jl:1518
in typeinf at ./inference.jl:1307
in typeinf at ./inference.jl:1257
in abstract_call_gf at ./inference.jl:696
in abstract_call at ./inference.jl:857
in abstract_eval_call at ./inference.jl:904
in abstract_eval at ./inference.jl:931
in typeinf_uncached at ./inference.jl:1591
in typeinf at ./inference.jl:1307
in typeinf_ext at ./inference.jl:1251
in linsolve at /Users/solver/.julia/v0.4/ApproxFun/src/Operators/linsolve.jl:108
in linsolve at /Users/solver/.julia/v0.4/ApproxFun/src/Operators/linsolve.jl:126
in linsolve at /Users/solver/.julia/v0.4/ApproxFun/src/Operators/linsolve.jl:130
in ./ at /Users/solver/.julia/v0.4/ApproxFun/src/Extras/specialfunctions.jl:89
The text was updated successfully, but these errors were encountered: