Skip to content

Should not issue error on property assignments to function/class declarations in block scopes. #16271

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Reported by @OliverJAsh in #16239:

{
class Foo {}
Foo.bar = 1; // error

const Foo2 = () => {};
Foo2.bar = 1; // error

function FooBar() {}
FooBar.bar = 1; // error
}

None of these should error in JS checking. This may have to do with how we resolve function declarations in block bodies (i.e. we look them up in the containing function scope, not the block scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specifically

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions