Skip to content

Conversation

@KlausC
Copy link
Contributor

@KlausC KlausC commented Jan 4, 2018

#25384

a dummy version of replace! has been added, which throws MethodError for unsupported argument types.

@rfourquet
Copy link
Member

Is the first commit here intended to be in this PR?

@KlausC
Copy link
Contributor Author

KlausC commented Jan 4, 2018

@rfourquet no - the first commit should be unrelated and forms a separate PR.

base/set.jl Outdated


replace!(prednew::Callable, A; count::Int=typemax(Int)) =
throw(MethodError(replace!, (prednew, A, count)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation. Also, count is not a positional argument, so I don't think it should be passed to MethodError (I'm not sure how it could be passed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first commit was by error - I will back that out.
Next commit will include your suggestions.

@nalimilan
Copy link
Member

Makes sense to me, but why is the first included here?

@JeffBezanson JeffBezanson merged commit 9dd18b1 into JuliaLang:master Jan 5, 2018
@JeffBezanson
Copy link
Member

Oh dear, this causes a method overwrite that I didn't notice at first. This will have to be reverted. The many signatures of this function really make my head hurt. There are about 15 barely-distinguishable method signatures here. Surely we can simplify this somehow?

rfourquet added a commit that referenced this pull request Jan 6, 2018
`replace!` had one stack-overflow problem reported in #25384.
Its fix #25386 made a method-overwrite, tentatively fixed in #25422.
But `replace!` also didn't handle non-Int count arguments as
expected (because there is no dispatch on keyword arguments).
This fixes the root problem and adds tests for non-Int count.
@rfourquet
Copy link
Member

The many signatures of this function really make my head hurt. There are about 15 barely-distinguishable method signatures here. Surely we can simplify this somehow?

Then you are probably talking about replace rather than replace! ? There is a total of 5 methods (for both functions) which were introduced to avoid ambiguities, which I will revisit to see if this can be trimmed down, and two deprecated replace methods, which will disappear eventually.

rfourquet added a commit that referenced this pull request Jan 7, 2018
`replace!` had one stack-overflow problem reported in #25384.
Its fix #25386 made a method-overwrite, tentatively fixed in #25422.
But `replace!` also didn't handle non-Int count arguments as
expected (because there is no dispatch on keyword arguments).
This fixes the root problem and adds tests for non-Int count.
rfourquet added a commit that referenced this pull request Jan 8, 2018
`replace!` had one stack-overflow problem reported in #25384.
Its fix #25386 made a method-overwrite, tentatively fixed in #25422.
But `replace!` also didn't handle non-Int count arguments as
expected (because there is no dispatch on keyword arguments).
This fixes the root problem and adds tests for non-Int count.
JeffBezanson pushed a commit that referenced this pull request Jan 8, 2018
`replace!` had one stack-overflow problem reported in #25384.
Its fix #25386 made a method-overwrite, tentatively fixed in #25422.
But `replace!` also didn't handle non-Int count arguments as
expected (because there is no dispatch on keyword arguments).
This fixes the root problem and adds tests for non-Int count.
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

Successfully merging this pull request may close these issues.

4 participants