Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mstepin opened this issue Sep 5, 2024 · 0 comments

Comments

@mstepin
Copy link

mstepin commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant