Skip to content

Explorer errors for class constructors with arrays containing multiple elements #56

Description

@mstepin

consider this basic code:

type SomeType = {
    prop1: string;
    prop2: string;
}

type SomeOtherType = {
    prop3: string;
    prop4: string;
}
type AnySomeType = SomeType | SomeOtherType

export class SomeClass<T extends AnySomeType> {
    
    constructor([model, customProp]: [T, string]) {
        Object.assign(this, model);
        Object.assign(this, customProp);
    }
}
const yo = new SomeClass<SomeType>([{
    prop1: '',
    prop2: ''
}, 'thisIsCustom'])

Upon inspecting the const yo The explorer errors with "cannot read property of undefined (reading 'name')"
image

TS version: 5.2.2
Node version: 18.12.1
VS Code version: 1.92.2
OS: macOS Sonoma 14.6.1
TypeScript Explorer version: v0.4.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions