Skip to content

Commit 8acfdeb

Browse files
committed
Deprecate using && and || within at-dot expressions
Giving us space to allow lowering this to `.&&` and `.||` in the future. Ref #5187.
1 parent d1ee03f commit 8acfdeb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

base/broadcast.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,11 @@ function __dot__(x::Expr)
850850
Meta.isexpr(x.args[1], :call) # function or macro definition
851851
Expr(x.head, x.args[1], dotargs[2])
852852
else
853+
if x.head == :&& || x.head == :||
854+
Base.depwarn("""
855+
using $(x.head) expressions in @. is deprecated; in the future it will
856+
become elementwise. Break the expression into smaller parts instead.""", ())
857+
end
853858
head = string(x.head)
854859
if last(head) == '=' && first(head) != '.'
855860
Expr(Symbol('.',head), dotargs...)

base/deprecated.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function depwarn(msg, funcsym)
8282
_id=(frame,funcsym),
8383
_group=:depwarn,
8484
caller=caller,
85-
maxlog=1
85+
maxlog=funcsym === () ? nothing : 1
8686
)
8787
nothing
8888
end

0 commit comments

Comments
 (0)