Skip to content

let block not allowed on lhs of .+= #44356

@goulart-paul

Description

@goulart-paul

Best explained by an example :

struct Foo{T}
    a::Vector{T}
end

n = 10
x = Foo(ones(n))
y = ones(n)

@views x.a[2:end] .+= y[2:end]  # <--- error 

The reported error is ERROR: syntax: invalid let syntax.

Confirmed on v1.7 and v1.5. Further discussion and a possible solution may be found on discourse here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collectionbugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions