diff --git a/base/deprecated.jl b/base/deprecated.jl index 7aa04d154d6de..88c604a38d923 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -782,7 +782,6 @@ import .Math: clamp # Deprecate vectorized ! @deprecate(!(A::AbstractArray{Bool}), .!A) # parens for #20541 @deprecate(!(B::BitArray), .!B) # parens for #20541 -!(::typeof(()->())) = () # make sure ! has at least 4 methods so that for-loops don't end up getting a back-edge to depwarn # Deprecate vectorized ~ @deprecate ~(A::AbstractArray) .~A diff --git a/base/inference.jl b/base/inference.jl index 50e1218edaed3..de0f584ecdda8 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -2310,6 +2310,11 @@ function abstract_call(@nospecialize(f), fargs::Union{Tuple{},Vector{Any}}, argt end return Conditional(a, bty, aty) end + elseif f === Core.Inference.not_int + aty = argtypes[2] + if isa(aty, Conditional) + return Conditional(aty.var, aty.elsetype, aty.vtype) + end end end return isa(rt, TypeVar) ? rt.ub : rt diff --git a/base/operators.jl b/base/operators.jl index 60860e71b3d08..d40cf227410e1 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -155,7 +155,7 @@ julia> "foo" ≠ "foo" false ``` """ -!=(x, y) = !(x == y)::Bool +!=(x, y) = !(x == y) const ≠ = != """ diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 984219814218e..6817d573ff4a3 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -524,12 +524,12 @@ (for (= ,i (: 1 (call (top >>) (call (top length) ,kw) 1))) (block ;; ii = i*2 - 1 - (= ,ii (call (top -) (call (top *) ,i 2) 1)) + (= ,ii (call (top sub_int) (call (top mul_int) ,i 2) 1)) (= ,elt (call (core arrayref) true ,kw ,ii)) ,(foldl (lambda (kn else) (let* ((k (car kn)) (rval0 `(call (core arrayref) true ,kw - (call (top +) ,ii 1))) + (call (top add_int) ,ii 1))) ;; note: if the "declared" type of a KW arg ;; includes something from keyword-sparams ;; then don't assert it here, since those static @@ -569,7 +569,7 @@ 'ccall 2 ,rkw (tuple ,elt (call (core arrayref) true ,kw - (call (top +) ,ii 1))))) + (call (top add_int) ,ii 1))))) (map (lambda (k temp) (cons (if (decl? k) `(,(car k) ,temp ,(caddr k)) temp) (decl-var k))) @@ -1720,7 +1720,7 @@ ,@(if outer? `((require-existing-local ,lhs)) '()) ,(expand-forms `(,while - (call (top !) (call (top done) ,coll ,state)) + (call (top not_int) (call (core typeassert) (call (top done) ,coll ,state) (core Bool))) (block ;; NOTE: enable this to force loop-local var #;,@(map (lambda (v) `(local ,v)) (lhs-vars lhs)) @@ -2548,10 +2548,10 @@ (inbounds true) (call (top setindex!) ,result ,oneresult ,ri) (inbounds pop) - (= ,ri (call (top +) ,ri 1))) + (= ,ri (call (top add_int) ,ri 1))) `(block (= ,(car states) (call (top start) ,(car rv))) - (while (call (top !) (call (top done) ,(car rv) ,(car states))) + (while (call (top not_int) (call (core typeassert) (call (top done) ,(car rv) ,(car states)) (core Bool))) (scope-block (block (= (tuple ,(cadr (car ranges)) ,(car states))