Skip to content

Destructuring with private and protected members #7124

Closed
@xLama

Description

@xLama
class Foo {

    private sayFoo = () => {
        console.log('Foo')
    }

}

let foo = new Foo();
foo.sayFoo() // Error. It´s ok.

let {sayFoo} = foo;
sayFoo() // 'Foo' 

Is it by design?

Metadata

Metadata

Assignees

Labels

Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions