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

Backports to 1.0.1 #28764

Merged
merged 166 commits into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
d40a6b1
Documentation introduction fixed for 1.0 (#28548)
fredrikekre Aug 10, 2018
4e1178c
Autogenerate documented REPL banner (#28520)
HarrisonGrodin Aug 11, 2018
44dedda
update link to ConEmu terminal (#28578)
anderson15 Aug 11, 2018
c4c4199
Fix vec of adjoint vector (#28568)
andreasnoack Aug 12, 2018
7da396b
fix #28576, parsing `?` at end of input in conditional expression
JeffBezanson Aug 11, 2018
3ba7d66
Fix #28619, logabsdet for singular matrices (#28620)
garrison Aug 13, 2018
5cc92a7
Doc IndexLinear and IndexCartesian (#28476)
kshyatt Aug 13, 2018
25ed51e
Fix typo (#28594)
sgalal Aug 13, 2018
1d651ad
fix various `printstyled` calls (#28586)
pfitzseb Aug 13, 2018
6ef9630
fix print docstring (#28609)
bkamins Aug 13, 2018
2417246
fixes issue 28553, improves error message for missing packages (#28555)
affans Aug 14, 2018
ffa7047
Keep parametric information when constructing a SparseMatrixCSC from …
pkofod Aug 14, 2018
ecc1300
stop specializing on argument types of `display` (#28616)
KristofferC Aug 14, 2018
cd654a3
Change quit() to exit() (#28660)
anderson15 Aug 15, 2018
c097ec3
Fix input args in rem_pio2_kernel doc string (#28657)
pkofod Aug 15, 2018
5da38de
remove redundant text in a docstring (#28663)
bicycle1885 Aug 15, 2018
ef041dc
fix typo in a docstring (#28664)
bicycle1885 Aug 15, 2018
1169109
improve performance for number to string conversion functions (#28661)
KristofferC Aug 15, 2018
881d197
Fix throw_complex_domainerror error message for log[1p] (#28621)
garrison Aug 15, 2018
6abac45
fix #28641, passing typevars to `<:` in typejoin and tuplemerge (#28655)
JeffBezanson Aug 15, 2018
bd1ae7d
fix #28499, calling `cluster_cookie` before cluster starts (#28656)
JeffBezanson Aug 15, 2018
72f54d3
fix #28597, error for empty arrays with some negative dim sizes (#28659)
JeffBezanson Aug 15, 2018
b843f9e
fix performance in printf (#28670)
KristofferC Aug 16, 2018
a80df29
LinearAlgebra remove unused export (#28684)
KristofferC Aug 16, 2018
1834ed4
Complete uuids (#28649)
matbesancon Aug 16, 2018
a95f068
Fix issue #28624 (#28635)
favba Aug 16, 2018
fa8f0e6
add a code quote to a word (#28699)
KristofferC Aug 16, 2018
18ab3a4
smarter order of checks in jl_types_equal (#28677)
JeffBezanson Aug 16, 2018
ca151cc
fix some exported undefined variables and test this does not happen (…
KristofferC Aug 16, 2018
a4bdb8b
Use code font for `jl_value_t` in h2 (#28702)
dhermes Aug 16, 2018
abc36a7
fix REPL completions not always being unique (#28694)
KristofferC Aug 17, 2018
b24e624
Fix reinterpret performance
Keno Aug 16, 2018
ff8361a
Doc sorting algos (#28514)
kshyatt Aug 17, 2018
f22e4fc
Misc doc improvements (#28719)
fredrikekre Aug 18, 2018
02db595
Fix another missing GC root
Keno Aug 18, 2018
a871cb6
Fix missing gc root in jl_cglobal
Keno Aug 18, 2018
a39334b
add document on JULIA_PROJECT environment variable (#28556)
bicycle1885 Aug 19, 2018
5c6d9f4
Update style-guide.md (#28754)
annainfo Aug 19, 2018
238dbcf
Fix three missing gc roots in subtyping
Keno Aug 19, 2018
6770dd1
Remove mention of `reload` from the docs; fix #28572 (#28644)
mkborregaard Aug 19, 2018
0e19002
fix shuffle! on empty arrays (#28727)
rfourquet Aug 19, 2018
877495a
Example for parentindices
kshyatt Aug 17, 2018
68d4536
Add doctest example for broadcast!
kshyatt Aug 14, 2018
64e3ec3
Update Enums.jl (#28769)
Aug 19, 2018
79a7efd
fix description of kwargs... (#28757)
bicycle1885 Aug 20, 2018
2747c9c
added documentation for read command methods (#28748)
ExpandingMan Aug 20, 2018
bfd465b
fix two typos (#28731)
hertzsprung Aug 20, 2018
fe7fda3
Update integers-and-floating-point-numbers.md (#28744)
annainfo Aug 20, 2018
c0980d1
Resolve all method ambiguities in LinearAlgebra (#28749)
tkf Aug 21, 2018
271441b
improve performance of parse (#28787)
KristofferC Aug 22, 2018
e49de7c
Run ambiguity test inside a clean process; fixes 28804
tkf Aug 22, 2018
a8850d0
Update info about `versioninfo` in devdocs (#28810)
mmmm1998 Aug 23, 2018
93bce58
doc: change the canonical url to v1 instead of stable.
fredrikekre Aug 21, 2018
d402043
Patch Documenter v0.19.6 to create a correct version selector
fredrikekre Aug 22, 2018
2a447e7
add `Regex` documentation (#28703)
ChristianKurz Aug 23, 2018
a41626c
Added seekstart to getpass in base/util.jl (#28828) (#28832)
Seelengrab Aug 23, 2018
bd573ba
make cmp with BigInt return in [-1, 0, 1] (#28780)
rfourquet Aug 23, 2018
8b90fad
@schedule is deprecated, the code is no longer valid in 1.0 (#28800)
iht Aug 23, 2018
58f6dac
fix #28593, macro hygiene problems in type definitions (#28706)
JeffBezanson Aug 23, 2018
a1e78c1
fix doc-string references to bit-rotted variables x(->v) and v(->itr)…
thchr Aug 23, 2018
75b052f
Absolutify project path specified with --project and JULIA_PROJECT. (…
fredrikekre Aug 24, 2018
de44505
Make sure iterate(::Tuple) does not throw (#28847)
haampie Aug 24, 2018
e727600
Support ranges with different integer widths in `preduce` (#28651)
sbromberger Aug 24, 2018
19e0a35
fix doccing call overload without named argument (#28875)
KristofferC Aug 25, 2018
f7a1099
Fix note tag in the documentation (#28877)
ronisbr Aug 25, 2018
66c438b
improve docstring of pathof (#28817)
Aug 26, 2018
7248d44
issubset: check IteratorSize trait before calling length (#28871)
timholy Aug 26, 2018
30f03c6
improve performance for string(...) (#28876)
KristofferC Aug 26, 2018
e76071d
Compare Symbols and Chars more efficiently in Cholesky (#28873)
andreasnoack Aug 26, 2018
67ee273
accumulate: fix typo in docstring
rfourquet Aug 27, 2018
eda9f05
fix typo in append! doc
rfourquet Aug 27, 2018
255171e
removed outdated paragraph on automatic broadcasting for binary opera…
timziebart Aug 29, 2018
664ea94
Fix call to round for Julia 1.0 (#28944)
iht Aug 29, 2018
8791fc1
Getting Started: Capitalize "CPU" for consistency
apjanke Aug 29, 2018
51f6390
fix typo in `?@specialize`
ylxdzsw Aug 30, 2018
a16b7f4
Cross reference hasmethod with applicable in docs (#28918)
angusmoore Sep 1, 2018
eefe789
Fix spelling of kernel in html id (#28936)
simonbyrne Sep 1, 2018
718b560
doc/faq: move question to correct section (#28997)
stev47 Sep 2, 2018
d610b84
Docs for logging: write to file (#28927)
Sep 3, 2018
cb7900e
Vector lowering improvents in GC placement
Keno Aug 30, 2018
3f4435c
Fix typo in accumulate docstring (#28939)
garrison Aug 29, 2018
629164a
doc: fix accumulate examples not using the init keyword (#28910)
rfourquet Sep 3, 2018
71a65f1
CartesianIndices and LinearIndices docstring (#29023)
pablosanjose Sep 4, 2018
139974a
Fix out of bounds write in array deserialization
Keno Sep 3, 2018
d6e43e2
Fix download agent search relying on throwing of Sys.which(). Update …
wfrgra Sep 4, 2018
8078c1b
fix #28915, identity conversion to union of tuple types (#28951)
JeffBezanson Sep 4, 2018
def8356
Carry LLVM patch to fix incorrect codegen
Keno Aug 17, 2018
e35fe83
fixed regression in sparse of adjoint of sparse (#28948) (#28954)
ExpandingMan Sep 4, 2018
e99894f
no longer update on add
KristofferC Aug 13, 2018
8398ea6
Remove `--env` meta option
00vareladavid Aug 8, 2018
3d29983
Better info messages for activating new environment.
fredrikekre Aug 13, 2018
6cd963b
remove unnecessary version handling when dealing with repos, this is …
KristofferC Aug 13, 2018
713fcef
add path completions to add/dev in repl
pfitzseb Aug 7, 2018
80227fd
update the repo when the gitobject is not available
KristofferC Aug 14, 2018
1cc648a
Fix a bug where the path was stored as relative
fredrikekre Aug 15, 2018
97bbabd
update docs for develop
KristofferC Aug 13, 2018
e818a3f
fixup testing to be more isolated from env variables
KristofferC Jul 10, 2018
200b813
better path print
fredrikekre Aug 17, 2018
bb39549
Print stdlib paths more compactly, fix #605.
fredrikekre Aug 17, 2018
394d056
Update Pkg docs to reflect version change to v1.0
pkofod Aug 20, 2018
90b1bdb
Fix `preview`
00vareladavid Aug 8, 2018
7f4ed90
Declare an argument parser for each command
00vareladavid Aug 7, 2018
bcae2f2
Add a `description` field to `CommandSpec`
00vareladavid Aug 18, 2018
fec46bc
add develop for path
KristofferC Aug 13, 2018
7f88b2c
Use max/min to declare expected argument count
00vareladavid Aug 17, 2018
8f816db
work around strange "Unreachable reached" when the close function for…
KristofferC Aug 22, 2018
4137472
use default proxy credentials when downloading via powershell
KristofferC Sep 4, 2018
8729c63
Fix dispatch of SparseMatrixCSC*Diagonal multiplication (#29045)
Pbellive Sep 5, 2018
5279e48
fix #28900, macro hygiene bug inside keyword arg values (#29043)
JeffBezanson Sep 5, 2018
f5bf331
fix #28991, error when adding default defs to constructed module Expr…
JeffBezanson Sep 5, 2018
f928df4
Fix typo on file.jl (#29063)
zsz00 Sep 6, 2018
f160e4e
Fix typo in mapreduce docstring (#29049)
harryscholes Sep 6, 2018
f7bbec5
fix #28833, crash in macros returning certain top-level forms (#28882)
JeffBezanson Sep 6, 2018
059e36d
work around a splatting penalty in twiceprecision (#29060)
KristofferC Sep 6, 2018
780e74a
add local to outer description (#29010)
bkamins Sep 6, 2018
8c53843
stronger warnings about changing constants in help and docs (#28711)
JeffBezanson Sep 7, 2018
f889509
fix #29064, bug in field name same as struct type name (#29070)
JeffBezanson Sep 7, 2018
718cb82
fix #25955, hygiene of arg name of function defined by type (`(f::T)(…
JeffBezanson Sep 7, 2018
8edfd15
Documentation `mynorm` should not divide by n (#29091)
dehann Sep 8, 2018
e764100
fix logic in `getfield_nothrow` to allow removing more getfields
JeffBezanson Sep 7, 2018
c306dbc
fix #29083, not eliminating kwfunc due to logic error in builtin_nothrow
JeffBezanson Sep 7, 2018
e9093a1
doc/interface: correct signature of `size` (#29094)
iblislin Sep 8, 2018
af420c6
This comma confused me. Remove it
pepsiman Sep 8, 2018
d3096d8
Avoid duplicated =value in Enum errors.
jmert Sep 8, 2018
fd06f05
fix #29036, poor inference of `val,i = iterate(x,i)`
JeffBezanson Sep 7, 2018
447103c
slightly more efficient lowering of destructuring assignment
JeffBezanson Sep 7, 2018
a2de527
Check world age bounds on candidate ambiguities. Fixes #28899 (#28916)
timholy Sep 10, 2018
b86b435
Some more examples/formatting/xrefs for Distributed docs (#29011)
kshyatt Sep 11, 2018
843cfe8
Solving Issue #29101 (#29122)
lagefreitas Sep 11, 2018
76cc533
LibGit2: only call shutdown once [fix #28306] (#29121)
StefanKarpinski Sep 11, 2018
7834046
RFC: Iterate over smaller set for setdiff[!](a,b) (#29048)
laborg Sep 11, 2018
35e9ad4
Fix some signatures and add examples for Random docs (#29119)
kshyatt Sep 12, 2018
1ccc25f
fix perf regression from not specializing on iterate on tuples (#29133)
KristofferC Sep 12, 2018
04643c3
fix perf in exp(::Matrix) (#29116)
KristofferC Sep 12, 2018
9ee3f88
Tried to fix the English of the first few paras (#29050)
mark-summerfield Sep 12, 2018
21388f9
Some xrefs and examples for Distiributed (#29137)
kshyatt Sep 12, 2018
df76714
doc: fix usage of NTuple{T} (#29104)
stev47 Sep 12, 2018
b5e2c2f
Allow `Iterators.flatten` for empty tuple (#29112)
KlausC Sep 12, 2018
5ac0cdc
fix #22592, specificity of union compared to a subtype of it (#29139)
JeffBezanson Sep 13, 2018
a031553
fix unsigned ndigits with neg base for `n > typemax(n)÷2` (#29148)
rfourquet Sep 13, 2018
8118629
fixed some typos (#29164)
cormullion Sep 14, 2018
e174444
fix #25474, support more forms in edit, which, etc. macros (#29159)
JeffBezanson Sep 14, 2018
499fb01
Xrefs and a few examples for math stuff (#29150)
kshyatt Sep 14, 2018
b57c1f1
Add `undef` to Vector allocations (#29184)
hycakir Sep 15, 2018
3212800
fix #28481, faster reading of primitive types from IOStream and IOBuf…
JeffBezanson Sep 17, 2018
f952754
Improve support for constructing zero-step float ranges (#29056)
mbauman Sep 13, 2018
6c2eb8a
fix #29145, error for `new{}` with incomplete type (#29154)
JeffBezanson Sep 14, 2018
65278e4
fix #29175, invalid lowered IR from repeating code for declared types…
JeffBezanson Sep 17, 2018
6b715cd
Fix the statements for checking repeat in packages' UUID.
sunoru Sep 4, 2018
974f709
Close the braces in docstring
tkf Sep 6, 2018
3793eba
Throw PkgError instead of ErrorException when looking for the project…
fredrikekre Sep 11, 2018
86e6f43
Fix typo in help docs
00vareladavid Sep 11, 2018
e267492
Don't mutate argument passed to Pkg.add
tkf Sep 6, 2018
64eee04
Fix spelling of "precompile"
rdeits Sep 15, 2018
5b3ea04
fix type in isjoinable
KristofferC Sep 17, 2018
a92abd2
Only complete directories on `add`/`dev`
00vareladavid Sep 12, 2018
1a82cf6
add support for ssh protocol
Evizero Aug 28, 2018
08b1586
Update project.toml compat example
mcmcgrath13 Sep 4, 2018
15a25ff
only look up name from url if it is unset
KristofferC Sep 17, 2018
f039d97
Reword `activate` docs (#742)
00vareladavid Sep 18, 2018
98e50a8
only do a radiobutton if we are in interactive mode (#735)
KristofferC Sep 18, 2018
4ffd2a8
don't use startup.jl when precompiling, building and testing (#470)
fredrikekre Jul 6, 2018
15c443b
do not precompile packages that have opt out to precompilation
KristofferC Sep 12, 2018
997bddb
Add missing test dependencies to SparseArrays Project.toml (#29354)
ararslan Sep 25, 2018
93c3abd
See if building our own PCRE fixes the travis issues (#29162)
Keno Sep 13, 2018
1aaf6f0
bump JSON version check to a non-capped version (#29315)
KristofferC Sep 22, 2018
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ before_install:
BUILDOPTS="$BUILDOPTS USE_BINARYBUILDER_LLVM=1 LLVM_CONFIG=$TRAVIS_BUILD_DIR/usr/tools/llvm-config LLVM_SIZE=$TRAVIS_BUILD_DIR/usr/tools/llvm-size";
BUILDOPTS="$BUILDOPTS VERBOSE=1 USE_BLAS64=0 SUITESPARSE_INC=-I$(brew --prefix suite-sparse-julia)/include FORCE_ASSERTIONS=1";
BUILDOPTS="$BUILDOPTS LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas";
for lib in SUITESPARSE BLAS LAPACK GMP MPFR PCRE LIBUNWIND; do
for lib in SUITESPARSE BLAS LAPACK GMP MPFR LIBUNWIND; do
BUILDOPTS="$BUILDOPTS USE_SYSTEM_$lib=1";
done;
export LDFLAGS="-L$(brew --prefix openblas-julia)/lib -L$(brew --prefix suite-sparse-julia)/lib";
Expand Down
2 changes: 1 addition & 1 deletion README.windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Instructions for adding fonts to the terminal are available at

Additionally, rather than sticking with the default command prompt, you may want
to use a different terminal emulator program, such as
[Conemu](https://code.google.com/p/conemu-maximus5/) or [Mintty](
[Conemu](https://conemu.github.io/) or [Mintty](
https://github.com/mintty/mintty) (note that running Julia on Mintty needs a
copy of `stty.exe` in your `%PATH%` to work properly). Alternatively, you may
prefer the features of a more full-function IDE, such as [Juno](http://junolab.org),
Expand Down
5 changes: 4 additions & 1 deletion base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ f (generic function with 1 method)

julia> f(apple)
"I'm a Fruit with value: 1"

julia> Fruit(1)
apple::Fruit = 1
```

Values can also be specified inside a `begin` block, e.g.
Expand Down Expand Up @@ -100,7 +103,7 @@ macro enum(T, syms...)
length(s.args) == 2 && isa(s.args[1], Symbol)
i = Core.eval(__module__, s.args[2]) # allow exprs, e.g. uint128"1"
if !isa(i, Integer)
throw(ArgumentError("invalid value for Enum $typename, $s=$i; values must be integers"))
throw(ArgumentError("invalid value for Enum $typename, $s; values must be integers"))
end
i = convert(basetype, i)
s = s.args[1]
Expand Down
17 changes: 9 additions & 8 deletions base/abstractset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,15 @@ end
<=(l::AbstractSet, r::AbstractSet) = l ⊆ r

function issubset(l, r)

rlen = length(r)
#This threshold was empirically determined by repeatedly
#sampling using these two methods.
lenthresh = 70

if rlen > lenthresh && !isa(r, AbstractSet)
return issubset(l, Set(r))
if haslength(r)
rlen = length(r)
#This threshold was empirically determined by repeatedly
#sampling using these two methods (see #26198)
lenthresh = 70

if rlen > lenthresh && !isa(r, AbstractSet)
return issubset(l, Set(r))
end
end

for elt in l
Expand Down
2 changes: 1 addition & 1 deletion base/accumulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cumprod(x::AbstractVector) = cumprod(x, dims=1)
accumulate(op, A; dims::Integer, [init])

Cumulative operation `op` along the dimension `dims` of `A` (providing `dims` is optional
for vectors). An inital value `init` may optionally be privided by a keyword argument. See
for vectors). An initial value `init` may optionally be provided by a keyword argument. See
also [`accumulate!`](@ref) to use a preallocated output array, both for performance and
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)
Expand Down
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ julia> append!([1, 2, 3], [4, 5, 6])
```

Use [`push!`](@ref) to add individual items to `collection` which are not already
themselves in another collection. The result is of the preceding example is equivalent to
themselves in another collection. The result of the preceding example is equivalent to
`push!([1, 2, 3], 4, 5, 6)`.
"""
function append!(a::Array{<:Any,1}, items::AbstractVector)
Expand Down
24 changes: 24 additions & 0 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,30 @@ Like [`broadcast`](@ref), but store the result of
Note that `dest` is only used to store the result, and does not supply
arguments to `f` unless it is also listed in the `As`,
as in `broadcast!(f, A, A, B)` to perform `A[:] = broadcast(f, A, B)`.

# Examples
```jldoctest
julia> A = [1.0; 0.0]; B = [0.0; 0.0];

julia> broadcast!(+, B, A, (0, -2.0));

julia> B
2-element Array{Float64,1}:
1.0
-2.0

julia> A
2-element Array{Float64,1}:
1.0
0.0

julia> broadcast!(+, A, A, (0, -2.0));

julia> A
2-element Array{Float64,1}:
1.0
-2.0
```
"""
broadcast!(f::Tf, dest, As::Vararg{Any,N}) where {Tf,N} = (materialize!(dest, broadcasted(f, As...)); dest)

Expand Down
2 changes: 1 addition & 1 deletion base/cartesian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ would generate:
end
end

If you want just a post-expression, supply `nothing` for the pre-expression. Using
If you want just a post-expression, supply [`nothing`](@ref) for the pre-expression. Using
parentheses and semicolons, you can supply multi-statement expressions.
"""
macro nloops(N, itersym, rangeexpr, args...)
Expand Down
2 changes: 1 addition & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function repl_cmd(cmd, out)
# If it's intended to simulate `cd`, it should instead be doing
# more nearly `cd $dir && printf %s \$PWD` (with appropriate quoting),
# since shell `cd` does more than just `echo` the result.
dir = read(`$shell -c "printf %s $(shell_escape_posixly(dir))"`, String)
dir = read(`$shell -c "printf '%s' $(shell_escape_posixly(dir))"`, String)
end
cd(dir)
end
Expand Down
27 changes: 19 additions & 8 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ function abstract_call_gf_by_type(@nospecialize(f), argtypes::Vector{Any}, @nosp
rettype = Bottom
edgecycle = false
edges = Any[]
nonbot = 0 # the index of the only non-Bottom inference result if > 0
seen = 0 # number of signatures actually inferred
for i in 1:napplicable
match = applicable[i]::SimpleVector
method = match[3]::Method
sig = match[1]
sigtuple = unwrap_unionall(sig)::DataType
splitunions = false
this_rt = Bottom
# TODO: splitunions = 1 < countunionsplit(sigtuple.parameters) * napplicable <= sv.params.MAX_UNION_SPLITTING
# currently this triggers a bug in inference recursion detection
if splitunions
Expand All @@ -71,24 +74,32 @@ function abstract_call_gf_by_type(@nospecialize(f), argtypes::Vector{Any}, @nosp
push!(edges, edge)
end
edgecycle |= edgecycle1::Bool
rettype = tmerge(rettype, rt)
rettype === Any && break
this_rt = tmerge(this_rt, rt)
this_rt === Any && break
end
rettype === Any && break
else
rt, edgecycle, edge = abstract_call_method(method, sig, match[2]::SimpleVector, sv)
this_rt, edgecycle, edge = abstract_call_method(method, sig, match[2]::SimpleVector, sv)
if edge !== nothing
push!(edges, edge)
end
rettype = tmerge(rettype, rt)
rettype === Any && break
end
if this_rt !== Bottom
if nonbot === 0
nonbot = i
else
nonbot = -1
end
end
seen += 1
rettype = tmerge(rettype, this_rt)
rettype === Any && break
end
if napplicable == 1 && !edgecycle && isa(rettype, Type) && sv.params.ipo_constant_propagation
# try constant propagation if only 1 method is inferred to non-Bottom
if nonbot > 0 && seen == napplicable && !edgecycle && isa(rettype, Type) && sv.params.ipo_constant_propagation
# if there's a possibility we could constant-propagate a better result
# (hopefully without doing too much work), try to do that now
# TODO: it feels like this could be better integrated into abstract_call_method / typeinf_edge
const_rettype = abstract_call_method_with_const_args(f, argtypes, applicable[1]::SimpleVector, sv)
const_rettype = abstract_call_method_with_const_args(f, argtypes, applicable[nonbot]::SimpleVector, sv)
if const_rettype ⊑ rettype
# use the better result, if it's a refinement of rettype
rettype = const_rettype
Expand Down
6 changes: 3 additions & 3 deletions base/compiler/ssair/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function show_ir(io::IO, code::IRCode, expr_type_printer=default_expr_type_print
bb_idx = 1
new_nodes = code.new_nodes
if any(i -> !isassigned(code.new_nodes, i), 1:length(code.new_nodes))
printstyled(io, :red, "ERROR: New node array has unset entry\n")
printstyled(io, "ERROR: New node array has unset entry\n", color=:red)
new_nodes = new_nodes[filter(i -> isassigned(code.new_nodes, i), 1:length(code.new_nodes))]
end
for nn in new_nodes
Expand All @@ -354,7 +354,7 @@ function show_ir(io::IO, code::IRCode, expr_type_printer=default_expr_type_print
if !isassigned(stmts, idx)
# This is invalid, but do something useful rather
# than erroring, to make debugging easier
printstyled(io, :red, "#UNDEF\n")
printstyled(io, "#UNDEF\n", color=:red)
continue
end
stmt = stmts[idx]
Expand Down Expand Up @@ -495,7 +495,7 @@ function show_ir(io::IO, code::CodeInfo, expr_type_printer=default_expr_type_pri
if !isassigned(stmts, idx)
# This is invalid, but do something useful rather
# than erroring, to make debugging easier
printstyled(io, :red, "#UNDEF\n")
printstyled(io, "#UNDEF\n", color=:red)
continue
end
stmt = stmts[idx]
Expand Down
8 changes: 5 additions & 3 deletions base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,10 @@ function getfield_nothrow(@nospecialize(s00), @nospecialize(name), @nospecialize
sv = s00.val
end
if isa(name, Const)
(isa(sv, Module) && isa(name.val, Symbol)) || return false
(isa(name.val, Symbol) || isa(name.val, Int)) || return false
if !isa(name.val, Symbol)
isa(sv, Module) && return false
isa(name.val, Int) || return false
end
return isdefined(sv, name.val)
end
if bounds_check_disabled && !isa(sv, Module)
Expand Down Expand Up @@ -1056,7 +1058,7 @@ function _builtin_nothrow(@nospecialize(f), argtypes::Array{Any,1}, @nospecializ
length(argtypes) == 1 || return false
return sizeof_nothrow(argtypes[1])
elseif f === Core.kwfunc
length(argtypes) == 2 || return false
length(argtypes) == 1 || return false
return isa(rt, Const)
end
return false
Expand Down
3 changes: 3 additions & 0 deletions base/compiler/typelimits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ function tuplemerge(a::DataType, b::DataType)
for loop_b = (false, true)
for i = (lt + 1):(loop_b ? lbr : lar)
ti = unwrapva(loop_b ? bp[i] : ap[i])
while ti isa TypeVar
ti = ti.ub
end
# compare (ti <-> tail), (wrapper ti <-> tail), (ti <-> wrapper tail), then (wrapper ti <-> wrapper tail)
# until we find the first element that contains the other in the pair
# TODO: this result would be more stable (and more associative and more commutative)
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function retrieve_code_info(linfo::MethodInstance)
end

function code_for_method(method::Method, @nospecialize(atypes), sparams::SimpleVector, world::UInt, preexisting::Bool=false)
if world < min_world(method)
if world < min_world(method) || world > max_world(method)
return nothing
end
if isdefined(method, :generator) && !isdispatchtuple(atypes)
Expand Down
2 changes: 1 addition & 1 deletion base/docs/Docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function astname(x::Expr, ismacro::Bool)
ismacro ? macroname(x) : x
# Call overloading, e.g. `(a::A)(b) = b` or `function (a::A)(b) b end` should document `A(b)`
elseif (isexpr(x, :function) || isexpr(x, :(=))) && isexpr(x.args[1], :call) && isexpr(x.args[1].args[1], :(::))
return astname(x.args[1].args[1].args[2], ismacro)
return astname(x.args[1].args[1].args[end], ismacro)
else
n = isexpr(x, (:module, :struct)) ? 2 : 1
astname(x.args[n], ismacro)
Expand Down
22 changes: 13 additions & 9 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ kw"'"
"""
const

`const` is used to declare global variables which are also constant. In almost all code
`const` is used to declare global variables whose values will not change. In almost all code
(and particularly performance sensitive code) global variables should be declared
constant in this way.

Expand All @@ -275,15 +275,17 @@ const y, z = 7, 11

Note that `const` only applies to one `=` operation, therefore `const x = y = 1`
declares `x` to be constant but not `y`. On the other hand, `const x = const y = 1`
declares both `x` and `y` as constants.
declares both `x` and `y` constant.

Note that "constant-ness" is not enforced inside containers, so if `x` is an array or
dictionary (for example) you can still add and remove elements.
Note that "constant-ness" does not extend into mutable containers; only the
association between a variable and its value is constant.
If `x` is an array or dictionary (for example) you can still modify, add, or remove elements.

Technically, you can even redefine `const` variables, although this will generate a
warning from the compiler. The only strict requirement is that the *type* of the
variable does not change, which is why `const` variables are much faster than regular
globals.
In some cases changing the value of a `const` variable gives a warning instead of
an error.
However, this can produce unpredictable behavior or corrupt the state of your program,
and so should be avoided.
This feature is intended only for convenience during interactive use.
"""
kw"const"

Expand Down Expand Up @@ -855,7 +857,7 @@ ErrorException
WrappedException(msg)

Generic type for `Exception`s wrapping another `Exception`, such as `LoadError` and
`InitError`. Those exceptions contain information about the the root cause of an
`InitError`. Those exceptions contain information about the root cause of an
exception. Subtypes define a field `error` containing the causing `Exception`.
"""
Core.WrappedException
Expand Down Expand Up @@ -1083,6 +1085,8 @@ InterruptException

Determine whether the given generic function has a method applicable to the given arguments.

See also [`hasmethod`](@ref).

# Examples
```jldoctest
julia> function f(x, y)
Expand Down
24 changes: 5 additions & 19 deletions base/download.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

# file downloading

downloadcmd = nothing
if Sys.iswindows()
downloadcmd = "powershell"
function download(url::AbstractString, filename::AbstractString)
ps = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
tls12 = "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
Expand All @@ -25,28 +23,16 @@ if Sys.iswindows()
end
else
function download(url::AbstractString, filename::AbstractString)
global downloadcmd
if downloadcmd === nothing
for checkcmd in ("curl", "wget", "fetch")
try
# Sys.which() will throw() if it can't find `checkcmd`
Sys.which(checkcmd)
downloadcmd = checkcmd
break
catch
end
end
end
if downloadcmd == "wget"
if Sys.which("curl") !== nothing
run(`curl -g -L -f -o $filename $url`)
elseif Sys.which("wget") !== nothing
try
run(`wget -O $filename $url`)
catch
rm(filename) # wget always creates a file
rm(filename, force=true) # wget always creates a file
rethrow()
end
elseif downloadcmd == "curl"
run(`curl -g -L -f -o $filename $url`)
elseif downloadcmd == "fetch"
elseif Sys.which("fetch") !== nothing
run(`fetch -f $filename $url`)
else
error("no download agent available; install curl, wget, or fetch")
Expand Down
2 changes: 2 additions & 0 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
end
if ex.world < min_world(method)
print(iob, " (method too new to be called from this world context.)")
elseif ex.world > max_world(method)
print(iob, " (method deleted before this world age.)")
end
# TODO: indicate if it's in the wrong world
push!(lines, (buf, right_matches))
Expand Down
Loading