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

Manual doctests (part 4) #20224

Merged
merged 2 commits into from
Jan 28, 2017

Conversation

fredrikekre
Copy link
Member

Pretty straight forward commits, with a reservation on what is decided regarding showing backtraces (ref. #20202 (comment))

(make check-whitespace and the doctests pass locally, remove [ci skip] from commit message if/when this is merged)

@kshyatt kshyatt added the docs This change adds or pertains to documentation label Jan 25, 2017
@fredrikekre fredrikekre force-pushed the fe/manual-doctests-part4 branch from 6d0b9ed to e8f84d3 Compare January 27, 2017 00:03
@fredrikekre
Copy link
Member Author

Added backtraces again, need to decide what should be done with the !Matched printing. Ref #20183 (comment)

@fredrikekre fredrikekre mentioned this pull request Jan 27, 2017
38 tasks
@@ -241,23 +240,18 @@ julia> g(2, 3.0)
8.0

julia> g(2.0, 3.0)
ERROR: MethodError: g(::Float64, ::Float64) is ambiguous. Candidates:
g(x, y::Float64) in Main at none:1
g(x::Float64, y) in Main at none:1
Copy link
Contributor

Choose a reason for hiding this comment

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

we're showing the closest candidates in most of the others, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. But it cannot be done for this one, it will show closest candidates which are defined in the sandbox module which the test is run in. So either we don't doctest this or we leave out the closes candidates.

Copy link
Contributor

Choose a reason for hiding this comment

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

okay fair enough - so normal doctests run in Main but named ones don't?

Copy link
Member Author

Choose a reason for hiding this comment

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

They are run in Main, but all functions are defined in its own module. I think... These two tests both pass at least:

```jldoctest
julia> current_module()
Main
```

```jldoctest currentmod
julia> current_module()
Main
```

Note that this is the only one where this have been a problem. Perhaps we can skip the stacktrace for this one? The text section right after explains what is going on as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

julia> Foo((), 23.5, 1)
ERROR: InexactError()
in convert(::Type{Int64}, ::Float64) at ./float.jl:656
Copy link
Contributor

Choose a reason for hiding this comment

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

leave in for now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just missed to add back this one, will update.

@@ -624,7 +621,7 @@ arguments to the object constructor.
Since the type `Point{Float64}` is a concrete type equivalent to `Point` declared with [`Float64`](@ref)
Copy link
Contributor

Choose a reason for hiding this comment

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

there's some nonstandard indentation in the two norm examples in the collapsed block here, I'll get them at some point if you don't

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I will fix that when I update this PR


julia> Point{Float64}(1.0,2.0,3.0)
ERROR: MethodError: no method matching Point{Float64}(::Float64, ::Float64, ::Float64)
Closest candidates are:
Point{Float64}{T}(::Any, ::Any) at none:3
Point{Float64}{T}(::Any) at sysimg.jl:66
Copy link
Contributor

Choose a reason for hiding this comment

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

keep candidates?

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC there were none shown for this example. Note that there are no [...] added.

Copy link
Contributor

Choose a reason for hiding this comment

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

wonder if that's an intentional change?

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it might be a regression. Not sure yet, but maybe the type system rewrite? I'd be surprised if it were intended but might be wrong

Copy link
Contributor

Choose a reason for hiding this comment

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

bisected down to one of
3305d93
b32dd7c
e3bec2a
that made this stop printing - worth an issue I think

Copy link
Member Author

Choose a reason for hiding this comment

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

ref #20292

julia> f(2.0, 3)
ERROR: MethodError: no method matching f(::Float64, ::Int64)
Closest candidates are:
f(::Float64, !Matched::Float64) at none:1
...
f(::Float64, ::Float64) at none:1
Copy link
Contributor

Choose a reason for hiding this comment

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

ah right this is waiting on a color / !Matched decision

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

@fredrikekre fredrikekre force-pushed the fe/manual-doctests-part4 branch from e8f84d3 to a0663bd Compare January 28, 2017 00:22
@fredrikekre
Copy link
Member Author

Added !Matched here. make check-whitespace and added doctests pass (with --color=no)

@fredrikekre
Copy link
Member Author

fredrikekre commented Jan 28, 2017

Lets keep track of #20292 and update this when/if that issue is resolved, then this is good to go? That fix might also affect other doctests too.

@KristofferC KristofferC merged commit 40e6f8c into JuliaLang:master Jan 28, 2017
@KristofferC
Copy link
Member

Eeh I might have missunderstood the last comment and thumbs up.. Anyway we can fix it when the issue get resolved.

@fredrikekre
Copy link
Member Author

You did what I meant 😄

@fredrikekre fredrikekre deleted the fe/manual-doctests-part4 branch January 28, 2017 23:05
julia> Point(1,2.5)
ERROR: MethodError: no method matching Point{T}(::Int64, ::Float64)
...
ERROR: MethodError: no method matching Point(::Int64, ::Float64)
Copy link
Contributor

@tkelman tkelman Jan 28, 2017

Choose a reason for hiding this comment

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

I also wonder whether the dropping of the {T} here was an intentional change or not

This was referenced Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants