Skip to content

Incorrect type inference of variables from indexing #83

Description

@wheeheee

Perhaps some part of the logic erroneously assumes that indexing must always produce an element?
The inlay hint and the subsequent "Possible method call error" shows that the LS does not know that M[:, L] is a Vector{T}.
Both the hint and the blue squigglies go away if I remove the where T....
Doesn't need to be a Matrix, a Vector works too.

function foobar(M::Matrix{T}) where T<:Number
    L = size(M, 2)
    x = M[:, L]
    xn = similar(x)
end

Screenshot below shows the inlay hint and the "possible method call error"

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions