Skip to content

Odd complaint about ---@cast #1317

@muppet9010

Description

@muppet9010

I have the below code and the language server's odd complaint about a ---@cast. You can see I added the same cast a few lines later and it doesn't complain about that one (even if I remove the first one).

image

    ---@cast removedWeaponDetails - nil
    if flamethrowerGiven == nil then
        Logging.LogPrint(errorMessageStart .. "target player can't be given a flamethrower for some odd reason: " .. data.target)
        return
    end
    ---@cast removedWeaponDetails - nil```

On-hover over the type when its first returned by the function,
![image](https://user-images.githubusercontent.com/40836017/178158221-47ea862c-cb0b-48fa-94c0-d6822e7d4553.png)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions