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

@which confused by constructors with keyword arguments #18434

Closed
nalimilan opened this issue Sep 10, 2016 · 0 comments
Closed

@which confused by constructors with keyword arguments #18434

nalimilan opened this issue Sep 10, 2016 · 0 comments
Assignees

Comments

@nalimilan
Copy link
Member

In the following, it's weird that the custom constructors is called, but that @which is not able to find it. It looks like adding keyword arguments creates a confusion with the fallback constructor.

julia> type A
       end

julia> (::Type{A})(x; y=1) = 1

julia> A(1)
1

julia> A(1; y=2)
1

julia> @which A(1; y=2)
ERROR: no unique matching method for the specified argument types
 in which(::Any, ::Any) at ./reflection.jl:467
@yuyichao yuyichao self-assigned this Sep 10, 2016
yuyichao added a commit that referenced this issue Sep 10, 2016
tkelman pushed a commit that referenced this issue Feb 22, 2017
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