Skip to content

Overload with mismatched types fails on self-assign #1178

Description

@CodeGreen0386

Minimal reproduction:

---@class Vector
---@operator div(number): Vector

---@return Vector
local function vector() return {} end

---@return number
local function number() return 1 end

local v = vector()

local position = vector()
position = position / number()

v = position

Should get a "Cannot assign number to Vector. " error on v.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions