We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
statement in namespace does not have any effect. It should be diagnosed.
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
0.27.x
The text was updated successfully, but these errors were encountered:
from #2763
Sorry, something went wrong.
in typescript, a should be 100 in both position
a
100
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._start = void 0; var a = 0; var NS; (function (NS) { a = 100; function foo() { console.log("a", 1, a); } NS.foo = foo; })(NS || (NS = {})); function _start() { console.log("a", 1, a); NS.foo(); } exports._start = _start; _start();
according to typescript grammar, namespace can have top level statement.
namespace
namespaceDeclaration : Namespace namespaceName '{' statementList? '}' ; statementList : statement+ ;
so parse and compile top level statement should be reasonable in namespace
Successfully merging a pull request may close this issue.
Bug description
statement in namespace does not have any effect. It should be diagnosed.
Steps to reproduce
compile and run this code will get
AssemblyScript version
0.27.x
The text was updated successfully, but these errors were encountered: