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

Sync Fork from Upstream Repo #2

Merged
merged 61 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d377785
Bump Documenter to 0.24.7 (#35227)
mortenpi Mar 23, 2020
b81ce9e
Fix brief doc trimming with empty and non-string headers, fixes #3521…
fredrikekre Mar 23, 2020
a171969
Add broadcasting examples to `in` and `∉` docstrings. (#35023)
CameronBieganek Mar 23, 2020
cf3c0a3
Update inference devdoc (#33802)
Liozou Mar 23, 2020
8617860
add implicit named tuple and keyword argument names (#34331)
JeffBezanson Mar 23, 2020
ee3be10
fix #28581 and specialize istriu/istril for structured matrices (#35213)
ranocha Mar 24, 2020
e7a9474
check dl===du in lu! for Tridiagonal (#35197)
ranocha Mar 24, 2020
9f08f88
Tests for LinearAlgebra.powm (#35101)
kshyatt Mar 24, 2020
3df8899
Fix generic mul accidental type promotion Int32 -> Int64 (#35164)
haampie Mar 24, 2020
64ee8ab
fix #35225, issubset on empty ranges (#35244)
rfourquet Mar 24, 2020
e3e9def
Tidy up ImmutableDict docstring (#35250)
harryscholes Mar 24, 2020
f449765
Fix #35231 improve type error message (#35238)
ssikdar1 Mar 24, 2020
1f78749
fix a bug preventing inlining of getindex of const globals (#35239)
JeffBezanson Mar 25, 2020
a9be54d
Update generator.jl (#35259)
r0cketr1kky Mar 25, 2020
7be8053
add LLVM patch D65174 to fix a compiler performance regression
JeffBezanson Mar 25, 2020
cc60547
Inline and use a non-splatting combine_axes in broadcast (#35260)
ChrisRackauckas Mar 25, 2020
f4c3f1d
don't attempt const prop with constant Arrays (#35253)
JeffBezanson Mar 26, 2020
458d4bb
Use typed-zero in sign() implementation (#34916)
jmert Mar 26, 2020
4c45a91
Make sum along dims of SymTridiagonal, Tridiagonal, Bidiagonal, Diago…
ranocha Mar 26, 2020
5ecc17f
Implement `accumulate` and friends for arbitrary iterators (#34656)
tkf Mar 26, 2020
7807224
update BB to LLVM_full
vchuravy Mar 26, 2020
e4372df
add patch list for LLVM 10
vchuravy Mar 27, 2020
614f644
adjust version bounds for LLVM10
vchuravy Mar 27, 2020
81a044f
fix #35272, searchsorted(3:-1:1, 2.5, rev=true) (#35274)
rfourquet Mar 27, 2020
8a39bc7
Enable color output whenever stdout is TTY (#34347)
karan0299 Mar 27, 2020
3534bc1
faster findfirst(==(int), unitrange) (#35256)
mcabbott Mar 27, 2020
d31b047
x % Unsigned, x % Signed (#34864)
JeffreySarnoff Mar 27, 2020
712731e
Fix broken show method for Base.LogicalIndex (#34551)
karan0299 Mar 27, 2020
b637cb7
Merge pull request #35262 from JuliaLang/jb/storemergeperf
vchuravy Mar 28, 2020
9ab3fb2
Revert "Enable color output whenever stdout is TTY (#34347)"
maleadt Mar 29, 2020
1da2480
Fix offset when widening collections
timholy Mar 29, 2020
7a63269
Move custom array types to testhelpers and use TSlow in
timholy Mar 29, 2020
f371270
Fix a typo in NEWS.md (#35296)
sostock Mar 29, 2020
ac22a6d
Merge pull request #35270 from JuliaLang/vc/llvm10
vchuravy Mar 29, 2020
d20184f
[LLVM8] add patches for D75072 and D65174
vchuravy Mar 29, 2020
02624ac
use Expected<ObjectPtr> for LLVM10 (#35301)
vchuravy Mar 30, 2020
12acd69
Merge pull request #35294 from JuliaLang/tb/pkgeval_color
maleadt Mar 30, 2020
7fbee97
fix a typekey_hash mistake with typeof(Union{})
vtjnash Mar 26, 2020
91153df
fix a typekey_hash mistake with Type
vtjnash Mar 27, 2020
0241c5f
turn Method.specializations into a simpler list+keyhash
vtjnash Mar 12, 2020
110e435
jitlayers: compute the minimum module merge (#35157)
vtjnash Mar 30, 2020
5dd6676
Linux: Remove `--nodetach` option for `xsel` copy. (#35180)
Mar 30, 2020
72d7341
Merge pull request #35300 from JuliaLang/vc/llvm8_pflege
vchuravy Mar 30, 2020
b6c06dd
bump utf8proc version, support Unicode 13 (#35282)
stevengj Mar 30, 2020
58034ad
Merge pull request #35099 from JuliaLang/jn/method-specs-list
vtjnash Mar 30, 2020
fa071ff
Merge pull request #35298 from JuliaLang/teh/collectto
JeffBezanson Mar 30, 2020
e1dc967
Fix manual about propagation of missing values (#35264)
nalimilan Mar 30, 2020
1b228ff
eltype-preserving indexing into LinRange (#35267)
sostock Mar 30, 2020
1077bc4
Patch REPL documentation for symbols ending with '=' (#35277)
Liozou Mar 30, 2020
cdc5e79
adding escape_raw_string()
mgkuhn Dec 15, 2019
b6dd448
fix #35305, need escaping when printing string macro calls
JeffBezanson Mar 30, 2020
60323b6
rename some uses of `ast` to `ir` where applicable (#35156)
JeffBezanson Mar 30, 2020
afb9ad4
add informative error message for `map!(f, array)` (#35186)
rfourquet Mar 31, 2020
bf8aae8
suggest calling cholesky(Hermitian(A)) for slightly non-Hermitian mat…
stevengj Mar 31, 2020
ddf79a8
Add rot! to BLAS in stdlib/LinearAlgebra, add generic rotate! and ref…
amontoison Mar 31, 2020
0b0b126
fix method error printing for missing (#35315)
KristofferC Mar 31, 2020
33df293
fix #35295, typo in change to `clipboard` on linux (#35310)
JeffBezanson Mar 31, 2020
351d7e9
Merge pull request #35309 from JuliaLang/jb/fix35305
JeffBezanson Mar 31, 2020
3048517
fix a bug in circular type detection (#35275)
JeffBezanson Mar 31, 2020
105ed11
fix struct tail initialization for inline reference allocation (#35291)
JeffBezanson Mar 31, 2020
c54f80c
make DictCompletion context module aware (#34908)
aviatesk Apr 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ New language features
macros and matrix constructors, which are whitespace sensitive, because expressions like
`[a ±b]` now get parsed as `[a ±(b)]` instead of `[±(a, b)]`. ([#34200])

* Passing an identifier `x` by itself as a keyword argument or named tuple element
is equivalent to `x=x`, implicitly using the name of the variable as the keyword
or named tuple field name.
Similarly, passing an `a.b` expression uses `b` as the keyword or field name ([#29333]).

* Packages can now provide custom hints to help users resolve errors by using the
`register_error_hint` function. Packages that define custom exception types
can support hints by calling `show_error_hints` from their `showerror` method. ([#35094])

* Support for Unicode 13.0.0 (via utf8proc 2.5) ([#35282]).

Language changes
----------------

Expand Down Expand Up @@ -85,9 +92,11 @@ New library features
* Function composition now works also on one argument `∘(f) = f` (#34251)
* `@NamedTuple{key1::Type1, ...}` macro for convenient `NamedTuple` declarations ([#34548]).

* `isapprox` (or `≈`) now has a one-argument "curried" method `isapprox(x)` which returns a function, like `isequal` (or `==`)` ([#32305]).
* `isapprox` (or `≈`) now has a one-argument "curried" method `isapprox(x)` which returns a function, like `isequal` (or `==`) ([#32305]).
* `Ref{NTuple{N,T}}` can be passed to `Ptr{T}`/`Ref{T}` `ccall` signatures ([#34199])
* `accumulate`, `cumsum`, and `cumprod` now support `Tuple` ([#34654]).
* `x::Signed % Unsigned` and `x::Unsigned % Signed` are supported for integer bitstypes.
* `signed(unsigned_type)` is supported for integer bitstypes, `unsigned(signed_type)` has been supported.
* `accumulate`, `cumsum`, and `cumprod` now support `Tuple` ([#34654]) and arbitrary iterators ([#34656]).
* In `splice!` with no replacement, values to be removed can now be specified with an
arbitrary iterable (instead of a `UnitRange`) ([#34524]).

Expand All @@ -106,6 +115,8 @@ Standard library changes
* `normalize` now supports multidimensional arrays ([#34239])
* `lq` factorizations can now be used to compute the minimum-norm solution to under-determined systems ([#34350]).
* The BLAS submodule now supports the level-2 BLAS subroutine `spmv!` ([#34320]).
* The BLAS submodule now supports the level-1 BLAS subroutine `rot!` ([#35124]).
* New generic `rotate!(x, y, c, s)` and `reflect!(x, y, c, s)` functions ([#35124]).

#### Markdown

Expand Down
6 changes: 5 additions & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,11 @@ julia> a
6.0
```
"""
map!(f::F, dest::AbstractArray, As::AbstractArray...) where {F} = map_n!(f, dest, As)
function map!(f::F, dest::AbstractArray, As::AbstractArray...) where {F}
isempty(As) && throw(ArgumentError(
"""map! requires at least one "source" argument"""))
map_n!(f, dest, As)
end

map(f) = f()
map(f, iters...) = collect(Generator(f, iters...))
Expand Down
27 changes: 23 additions & 4 deletions base/accumulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ function cumsum(A::AbstractArray{T}; dims::Integer) where T
end

"""
cumsum(itr::Union{AbstractVector,Tuple})
cumsum(itr)

Cumulative sum an iterator. See also [`cumsum!`](@ref)
to use a preallocated output array, both for performance and to control the precision of the
output (e.g. to avoid overflow).

!!! compat "Julia 1.5"
`cumsum` on a tuple requires at least Julia 1.5.
`cumsum` on a non-array iterator requires at least Julia 1.5.

# Examples
```jldoctest
Expand All @@ -117,6 +117,12 @@ julia> cumsum([fill(1, 2) for i in 1:3])

julia> cumsum((1, 1, 1))
(1, 2, 3)

julia> cumsum(x^2 for x in 1:3)
3-element Array{Int64,1}:
1
5
14
```
"""
cumsum(x::AbstractVector) = cumsum(x, dims=1)
Expand Down Expand Up @@ -170,14 +176,14 @@ function cumprod(A::AbstractArray; dims::Integer)
end

"""
cumprod(itr::Union{AbstractVector,Tuple})
cumprod(itr)

Cumulative product of an iterator. See also
[`cumprod!`](@ref) to use a preallocated output array, both for performance and
to control the precision of the output (e.g. to avoid overflow).

!!! compat "Julia 1.5"
`cumprod` on a tuple requires at least Julia 1.5.
`cumprod` on a non-array iterator requires at least Julia 1.5.

# Examples
```jldoctest
Expand All @@ -195,6 +201,12 @@ julia> cumprod([fill(1//3, 2, 2) for i in 1:3])

julia> cumprod((1, 2, 1))
(1, 2, 2)

julia> cumprod(x^2 for x in 1:3)
3-element Array{Int64,1}:
1
4
36
```
"""
cumprod(x::AbstractVector) = cumprod(x, dims=1)
Expand All @@ -210,6 +222,9 @@ also [`accumulate!`](@ref) to use a preallocated output array, both for performa
to control the precision of the output (e.g. to avoid overflow). For common operations
there are specialized variants of `accumulate`, see: [`cumsum`](@ref), [`cumprod`](@ref)

!!! compat "Julia 1.5"
`accumulate` on a non-array iterator requires at least Julia 1.5.

# Examples
```jldoctest
julia> accumulate(+, [1,2,3])
Expand Down Expand Up @@ -250,6 +265,10 @@ julia> accumulate(+, fill(1, 3, 3), dims=2)
```
"""
function accumulate(op, A; dims::Union{Nothing,Integer}=nothing, kw...)
if dims === nothing && !(A isa AbstractVector)
# This branch takes care of the cases not handled by `_accumulate!`.
return collect(Iterators.accumulate(op, A; kw...))
end
nt = kw.data
if nt isa NamedTuple{()}
out = similar(A, promote_op(op, eltype(A), eltype(A)))
Expand Down
9 changes: 8 additions & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ end
function setindex_widen_up_to(dest::AbstractArray{T}, el, i) where T
@_inline_meta
new = similar(dest, promote_typejoin(T, typeof(el)))
copyto!(new, firstindex(new), dest, firstindex(dest), i-1)
f = first(LinearIndices(dest))
copyto!(new, first(LinearIndices(new)), dest, f, i-f)
@inbounds new[i] = el
return new
end
Expand Down Expand Up @@ -1791,6 +1792,12 @@ end
findfirst(testf::Function, A::Union{AbstractArray, AbstractString}) =
findnext(testf, A, first(keys(A)))

findfirst(p::Union{Fix2{typeof(isequal),Int},Fix2{typeof(==),Int}}, r::OneTo{Int}) =
1 <= p.x <= r.stop ? p.x : nothing

findfirst(p::Union{Fix2{typeof(isequal),T},Fix2{typeof(==),T}}, r::AbstractUnitRange) where {T<:Integer} =
first(r) <= p.x <= last(r) ? 1+Int(p.x - first(r)) : nothing

function findfirst(p::Union{Fix2{typeof(isequal),T},Fix2{typeof(==),T}}, r::StepRange{T,S}) where {T,S}
isempty(r) && return nothing
minimum(r) <= p.x <= maximum(r) || return nothing
Expand Down
1 change: 1 addition & 0 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ julia> Broadcast.combine_axes(1, 1, 1)
```
"""
@inline combine_axes(A, B...) = broadcast_shape(axes(A), combine_axes(B...))
@inline combine_axes(A, B) = broadcast_shape(axes(A), axes(B))
combine_axes(A) = axes(A)

# shape (i.e., tuple-of-indices) inputs
Expand Down
10 changes: 7 additions & 3 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@ function abstract_call_method_with_const_args(@nospecialize(rettype), @nospecial
# don't propagate constant index into indexing of non-constant array
if arrty isa Type && arrty <: AbstractArray && !issingletontype(arrty)
return Any
elseif arrty ⊑ Array
return Any
end
elseif istopfunction(f, :iterate)
itrty = argtypes[2]
if itrty isa Type && !issingletontype(itrty)
return Any
elseif itrty ⊑ Array
return Any
end
end
end
Expand All @@ -237,13 +241,13 @@ function abstract_call_method_with_const_args(@nospecialize(rettype), @nospecial
# decide if it's likely to be worthwhile
if !force_inference
code = inf_for_methodinstance(mi, sv.params.world)
declared_inline = isdefined(method, :source) && ccall(:jl_ast_flag_inlineable, Bool, (Any,), method.source)
declared_inline = isdefined(method, :source) && ccall(:jl_ir_flag_inlineable, Bool, (Any,), method.source)
cache_inlineable = declared_inline
if isdefined(code, :inferred) && !cache_inlineable
cache_inf = code.inferred
if !(cache_inf === nothing)
cache_src_inferred = ccall(:jl_ast_flag_inferred, Bool, (Any,), cache_inf)
cache_src_inlineable = ccall(:jl_ast_flag_inlineable, Bool, (Any,), cache_inf)
cache_src_inferred = ccall(:jl_ir_flag_inferred, Bool, (Any,), cache_inf)
cache_src_inlineable = ccall(:jl_ir_flag_inlineable, Bool, (Any,), cache_inf)
cache_inlineable = cache_src_inferred && cache_src_inlineable
end
end
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ intrinsic_effect_free_if_nothrow(f) = f === Intrinsics.pointerref || is_pure_int
plus_saturate(x::Int, y::Int) = max(x, y, x+y)

# known return type
isknowntype(@nospecialize T) = (T === Union{}) || isconcretetype(T)
isknowntype(@nospecialize T) = (T === Union{}) || isa(T, Const) || isconcretetype(widenconst(T))

function statement_cost(ex::Expr, line::Int, src::CodeInfo, sptypes::Vector{Any}, slottypes::Vector{Any}, params::Params)
head = ex.head
Expand Down
6 changes: 3 additions & 3 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ function analyze_method!(idx::Int, sig::Signature, @nospecialize(metharg), meths
return spec_lambda(atype_unlimited, sv, invoke_data)
end

src_inferred = ccall(:jl_ast_flag_inferred, Bool, (Any,), src)
src_inlineable = ccall(:jl_ast_flag_inlineable, Bool, (Any,), src)
src_inferred = ccall(:jl_ir_flag_inferred, Bool, (Any,), src)
src_inlineable = ccall(:jl_ir_flag_inlineable, Bool, (Any,), src)

if !(src_inferred && src_inlineable)
return spec_lambda(atype_unlimited, sv, invoke_data)
Expand All @@ -722,7 +722,7 @@ function analyze_method!(idx::Int, sig::Signature, @nospecialize(metharg), meths
add_backedge!(mi, sv)

if !isa(src, CodeInfo)
src = ccall(:jl_uncompress_ast, Any, (Any, Ptr{Cvoid}, Any), method, C_NULL, src::Vector{UInt8})::CodeInfo
src = ccall(:jl_uncompress_ir, Any, (Any, Ptr{Cvoid}, Any), method, C_NULL, src::Vector{UInt8})::CodeInfo
end

@timeit "inline IR inflation" begin
Expand Down
4 changes: 2 additions & 2 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function cache_result(result::InferenceResult, min_valid::UInt, max_valid::UInt)
nslots = length(inferred_result.slotflags)
resize!(inferred_result.slottypes, nslots)
resize!(inferred_result.slotnames, nslots)
inferred_result = ccall(:jl_compress_ast, Any, (Any, Any), def, inferred_result)
inferred_result = ccall(:jl_compress_ir, Any, (Any, Any), def, inferred_result)
else
inferred_result = nothing
end
Expand Down Expand Up @@ -559,7 +559,7 @@ function typeinf_ext(mi::MethodInstance, params::Params)
return inf
elseif isa(inf, Vector{UInt8})
i == 2 && ccall(:jl_typeinf_end, Cvoid, ())
inf = _uncompressed_ast(code, inf)
inf = _uncompressed_ir(code, inf)
return inf
end
end
Expand Down
11 changes: 4 additions & 7 deletions base/compiler/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function retrieve_code_info(linfo::MethodInstance)
if c === nothing && isdefined(m, :source)
src = m.source
if isa(src, Array{UInt8,1})
c = ccall(:jl_uncompress_ast, Any, (Any, Ptr{Cvoid}, Any), m, C_NULL, src)
c = ccall(:jl_uncompress_ir, Any, (Any, Ptr{Cvoid}, Any), m, C_NULL, src)
else
c = copy(src::CodeInfo)
end
Expand All @@ -126,12 +126,9 @@ end
# get a handle to the unique specialization object representing a particular instantiation of a call
function specialize_method(method::Method, @nospecialize(atypes), sparams::SimpleVector, preexisting::Bool=false)
if preexisting
if method.specializations !== nothing
# check cached specializations
# for an existing result stored there
return ccall(:jl_specializations_lookup, Any, (Any, Any), method, atypes)
end
return nothing
# check cached specializations
# for an existing result stored there
return ccall(:jl_specializations_lookup, Any, (Any, Any), method, atypes)
end
return ccall(:jl_specializations_get_linfo, Ref{MethodInstance}, (Any, Any, Any), method, atypes, sparams)
end
Expand Down
8 changes: 4 additions & 4 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,14 @@ end
"""
ImmutableDict

ImmutableDict is a Dictionary implemented as an immutable linked list,
which is optimal for small dictionaries that are constructed over many individual insertions
`ImmutableDict` is a dictionary implemented as an immutable linked list,
which is optimal for small dictionaries that are constructed over many individual insertions.
Note that it is not possible to remove a value, although it can be partially overridden and hidden
by inserting a new value with the same key
by inserting a new value with the same key.

ImmutableDict(KV::Pair)

Create a new entry in the Immutable Dictionary for the key => value pair
Create a new entry in the `ImmutableDict` for a `key => value` pair

- use `(key => value) in dict` to see if this particular combination is in the properties set
- use `get(dict, key, default)` to retrieve the most recent value for a particular key
Expand Down
6 changes: 3 additions & 3 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ julia> "Hello!" :: IntOrString
"Hello!"

julia> 1.0 :: IntOrString
ERROR: TypeError: in typeassert, expected Union{Int64, AbstractString}, got Float64
ERROR: TypeError: in typeassert, expected Union{Int64, AbstractString}, got a value of type Float64
```
"""
Union
Expand Down Expand Up @@ -2237,7 +2237,7 @@ Outside of declarations `::` is used to assert that expressions and variables in
# Examples
```jldoctest
julia> (1+2)::AbstractFloat
ERROR: TypeError: typeassert: expected AbstractFloat, got Int64
ERROR: TypeError: typeassert: expected AbstractFloat, got a value of type Int64

julia> (1+2)::Int
3
Expand Down Expand Up @@ -2320,7 +2320,7 @@ The syntax `x::type` calls this function.
# Examples
```jldoctest
julia> typeassert(2.5, Int)
ERROR: TypeError: in typeassert, expected Int64, got Float64
ERROR: TypeError: in typeassert, expected Int64, got a value of type Float64
Stacktrace:
[...]
```
Expand Down
6 changes: 3 additions & 3 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function showerror(io::IO, ex::TypeError)
elseif isa(ex.got, Type)
targs = ("Type{", ex.got, "}")
else
targs = (typeof(ex.got),)
targs = ("a value of type $(typeof(ex.got))",)
end
if ex.context == ""
ctx = "in $(ex.func)"
Expand Down Expand Up @@ -317,7 +317,7 @@ function showerror(io::IO, ex::MethodError)
kwargs = pairs(ex.args[1])
ex = MethodError(f, ex.args[3:end])
end
if f == Base.convert && length(arg_types_param) == 2 && !is_arg_types
if f === Base.convert && length(arg_types_param) == 2 && !is_arg_types
f_is_function = true
show_convert_error(io, ex, arg_types_param)
elseif isempty(methods(f)) && isa(f, DataType) && f.abstract
Expand Down Expand Up @@ -351,7 +351,7 @@ function showerror(io::IO, ex::MethodError)
print(io, ")")
end
# catch the two common cases of element-wise addition and subtraction
if f in (Base.:+, Base.:-) && length(arg_types_param) == 2
if (f === Base.:+ || f === Base.:-) && length(arg_types_param) == 2
# we need one array of numbers and one number, in any order
if any(x -> x <: AbstractArray{<:Number}, arg_types_param) &&
any(x -> x <: Number, arg_types_param)
Expand Down
4 changes: 2 additions & 2 deletions base/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

Given a function `f` and an iterator `iter`, construct an iterator that yields
the values of `f` applied to the elements of `iter`.
The syntax `f(x) for x in iter [if cond(x)::Bool]` is syntax for constructing an instance of this
type. The `[if cond(x)::Bool]` expression is optional and acts as a "guard", effectively
The syntax for constructing an instance of this type is `f(x) for x in iter [if cond(x)::Bool] `.
The `[if cond(x)::Bool]` expression is optional and acts as a "guard", effectively
filtering out values where the condition is false.

```jldoctest
Expand Down
7 changes: 6 additions & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import .Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), xor,
sum, trailing_zeros, trailing_ones, count_ones, tryparse_internal,
bin, oct, dec, hex, isequal, invmod, _prevpow2, _nextpow2, ndigits0zpb,
widen, signed, unsafe_trunc, trunc, iszero, isone, big, flipsign, signbit,
hastypemax
sign, hastypemax

if Clong == Int32
const ClongMax = Union{Int8, Int16, Int32}
Expand Down Expand Up @@ -668,6 +668,11 @@ flipsign!(x::BigInt, y::Integer) = (signbit(y) && (x.size = -x.size); x)
flipsign( x::BigInt, y::Integer) = signbit(y) ? -x : x
flipsign( x::BigInt, y::BigInt) = signbit(y) ? -x : x
# above method to resolving ambiguities with flipsign(::T, ::T) where T<:Signed
function sign(x::BigInt)
isneg(x) && return -one(x)
ispos(x) && return one(x)
return x
end

show(io::IO, x::BigInt) = print(io, string(x))

Expand Down
Loading