Skip to content

semantic: no error happens with function a () {} var a = '' #18719

@sapphi-red

Description

@sapphi-red

An error should be output for the following code, but semantic does not report any errors:

function a() {}
var a = ''

playground
When I run this on Node, I get SyntaxError: Identifier 'a' has already been declared.

The error is properly shown for

var a = ''
function a() {}

Maybe related to #15961

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions