JuliaLang/julia

`@. vec = vec +1` gives unhelpful error

Open

#49.968 aberto em 26 de mai. de 2023

Ver no GitHub
 (9 comments) (1 reaction) (0 assignees)Julia (5.773 forks)batch import
good first issue

Métricas do repositório

Stars
 (48.709 stars)
Métricas de merge de PR
 (Mesclagem média 20d 6h) (157 fundiu PRs em 30d)

Description

julia> vec = [1, 2, 3]
3-element Vector{Int64}:
 1
 2
 3

julia> @. vec = vec + 1
3-element Vector{Int64}:
 2
 3
 4

julia> @. vec = vec +1
ERROR: LoadError: MethodError: no method matching var"@__dot__"(::LineNumberNode, ::Module, ::Expr, ::Int64)
Closest candidates are:
  var"@__dot__"(::LineNumberNode, ::Module, ::Any) at broadcast.jl:1276
in expression starting at REPL[11]:1

Originally posted by @draftman9 in https://github.com/JuliaLang/julia/issues/49676#issuecomment-1538702202

Guia do colaborador