Skip to content

Commit 54f6810

Browse files
committed
warn on bare @threads as well
1 parent f625d7a commit 54f6810

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,11 @@ function generate_mainbody!(mod, found, expr::Expr, warn, warn_threads)
374374

375375
# If it's a macro, we expand it
376376
if Meta.isexpr(expr, :macrocall)
377-
if expr.args[1] == Expr(:., :Threads, QuoteNode(Symbol("@threads"))) &&
377+
if (
378+
expr.args[1] == Symbol("@threads") ||
379+
expr.args[1] == Expr(:., :Threads, QuoteNode(Symbol("@threads"))) &&
378380
!warn_threads
381+
)
379382
warn_threads = true
380383
@warn (
381384
"It looks like you are using `Threads.@threads` in your model definition." *

0 commit comments

Comments
 (0)