rsdn/nemerle — Issue #191: Code with Using keyword not compile alone without Main method
Author: CodingUnit
Created: 2011-12-01 20:30:17+00:00
State: open

This code:
```nemerle
using Nemerle;
using System;
using System.Console;
using System.IO;

File.WriteAllLines(@"test.txt", array["This is a test file.", "It is easy to read."] );

using (sr = File.OpenText("test.txt"))
{
def line1 = sr.ReadLine();
def line2 = sr.ReadLine();
WriteLine($"line1 = $line1");
WriteLine($"line2 = $line2");
}
```

not work in file alone, without using Main method with module, but Nemerle allow code without class, it automatical creates entry point for it.
Error signs:
```
E:\OpenSource\Nemerle\samples\ConsoleApplication1\ConsoleApplication3\Main.n(8,11): error : expected qualified identifier, got token (
E:\OpenSource\Nemerle\samples\ConsoleApplication1\ConsoleApplication3\Main.n(8,10): error : expecting `;' or `='
E:\OpenSource\Nemerle\samples\ConsoleApplication1\ConsoleApplication3\Main.n(9,5): error : expected `;'
E:\OpenSource\Nemerle\samples\ConsoleApplication1\ConsoleApplication3\Main.n(9,5): error : parse error near `{...}' group: unexpected token after expression in sequence (you forget a closing bracket?).

```