2

If I compile the following file

test.ts

#   
class Test {
}  

with

tsc test.ts

no output file is produced and the compiler does not give any warnings or errors. Running the compiler with debug turned on

tsc --debug test.ts

yields the following output:

Reading code from /usr/local/share/npm/lib/node_modules/typescript/bin/lib.d.ts
Found code at /usr/local/share/npm/lib/node_modules/typescript/bin/lib.d.ts
Reading code from /tmp/ts/directives/test.ts
Found code at /tmp/ts/directives/test.ts

If I put the hash line after the class declaration

test2.ts

class Test {
}
#  

the compiler reports no errors and generates output file

test2.js

var Test = (function () {
    function Test() { }
    return Test;
})();

What's going on here?

2

2 Answers 2

3

This has been fixed on the developer branch (0.8). Characters such as @ or # no longer block compilation. Please check the latest compiler.

Sign up to request clarification or add additional context in comments.

Comments

3

It's just a bug. This should be an error, as you expect.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.