Skip to content

Diagnose statement in namespace #2764

Closed
@HerrCai0907

Description

@HerrCai0907

Bug description

statement in namespace does not have any effect. It should be diagnosed.

Steps to reproduce

let a = 0;

namespace NS {
  a = 100; // here should be diagnosed
  export function foo(): void {
    trace("a", 1, a);
  }
}

export function _start(): void {
  trace("a", 1, a);
  NS.foo();
}

compile and run this code will get

a 0
a 0

AssemblyScript version

0.27.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions