-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
improve method name printing in edge cases #14884
Conversation
Corner case: julia> type A
end
julia> type B <: Function
end
julia> (::A)(x) = throw(x)
julia> (::B)(x) = throw(x)
julia> A()(1)
ERROR: 1
in (::A)(::Int64) at ./none:1
in eval at ./boot.jl:267
julia> B()(1)
ERROR: 1
in B(::Int64) at ./none:1
in eval at ./boot.jl:267 Not sure how to distinguish between a user defined (singleton) |
This appears on both master and this branch: julia> type B <: Function
end
julia> B()
B (generic function with 0 methods) |
some other possible conditionals that might help: |
|
hm, and here i was going to go with either should fix your example, but may make closures and the kwsorter less optimal:
however, the kwsorter doesn't have line-numbers, so it is hidden from backtraces anyways |
|
afb1769
to
5ecb288
Compare
yes, although i forgot in 0a9e6f9 why i initially hadn't done that. should be better now. |
Showing a custom julia> type B <: Function
end
julia> B()
(::B) (generic function with 0 methods)
julia> type C <: Function
x
end
julia> C(1)
(::C) (generic function with 0 methods) |
The way I see it, |
Fair enough given that we don't print the captured variables for closures either. |
Test failure is #14592 |
Looks like some test infrastructure is also confused though. |
From the code it looks like we neither recompile the function nor trying to get it from the sysimg? Seems that OSX CI passes since we are not running the |
c5aa517
to
5d0be48
Compare
rebased to try again on CI -- and all looks good (other than the travis worker that failed to start) |
|
||
method_defs_lineno = @__LINE__ | ||
Base.Symbol() = error(1) | ||
(::Symbol)() = error(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be touching base methods on base types in the tests like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it comes up, we can add a dummy argument (perhaps EightBitType). but for now, i specifically want to test Symbol since it has a special and unique representation.
Travis issue was a problem during the initial apt-get install of the ppa gcc version that we need due to recent llvm. I guess |
improve method name printing in edge cases
this fixes method printing for errors and a few edge cases.
fixed printing includes:
these fixes are repeated for
stacktrace
,MethodError
, andwritemime