<details> <summary>The second case</summary> ```lua Core = {}; ---@class Rotation ---@field Enabled boolean local Rotation = {} function Rotation:OnLoad() end function Rotation:OnUnload() end ---@class RotationEngine Core.RotationEngine = {} ---@generic T ---@param name `T` ---@return T|Rotation rotation function Core.RotationEngine.AddRotation(name) end ---@class MyRotation ---@field testfield table local MyRotation = {}; function MyRotation:Test() end local rotation = Core.RotationEngine.AddRotation("MyRotation"); ---@param self MyRotation ---@return boolean local function myFunc(self) end local a = myFunc(rotation); ``` </details> In the first case, in the `MyRotation` class, we seek methods of the `Rotation` class,  but also an error `Cannot assign MyRotation|Rotation to parameter MyRotation.Lua Diagnostics.(param-type-mismatch)`  <details> <summary>The second case</summary> ```lua Core = {}; ---@class Rotation ---@field Enabled boolean local Rotation = {} function Rotation:OnLoad() end function Rotation:OnUnload() end ---@class RotationEngine Core.RotationEngine = {} ---@generic T: Rotation ---@param name `T` ---@return T rotation function Core.RotationEngine.AddRotation(name) end ---@class MyRotation ---@field testfield table local MyRotation = {}; function MyRotation:Test() end local rotation = Core.RotationEngine.AddRotation("MyRotation"); ---@param self MyRotation ---@return boolean local function myFunc(self) end local a = myFunc(rotation); ``` </details> In the second case there is no inheritance  and there is no error either 
Activity
[-]`genetic` inheritance does not work[/-][+]`generic` inheritance does not work[/+]sumneko commentedon Jul 2, 2022
Need to add cross type features: