Skip to content

Missing fields not working for inherited classes #2740

Closed
@Riddle1001

Description

@Riddle1001

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

Have the fields from the parent class to be required

Actual Behaviour

The fields from the parent class are not required

Reproduction steps

---@class Animal
---@field name string
---@field age number

---@class Dog : Animal
---@field breed string

---@type Dog
local myDog = { -- Should throw missing fields error for "name" and "age"
	breed = "Labrador"
}

Additional Notes

image
image

Log File

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions