rsdn/nemerle — Issue #276: Uninformative error message during modifying immutable field
Author: CodingUnit
Created: 2012-02-01 18:02:02+00:00
State: open

This code makes error as expected, but not good information on error:

```nemerle
using Nemerle;
using System.Console;

public struct InnerDbRoot
{
public mutable d_new : int;
}

public class Dbx
{
public root : InnerDbRoot;

public calc_alloc() : void
{
root.d_new = 5; //Ee
}
}

module Test
{

Main() : void
{
def d = Dbx();

d.calc_alloc();
WriteLine(d.root.d_new);
_ = ReadLine();
}
}
```
error says:
```
error: this expression is not a proper lvalue: cannot load value type address
```
value type adress is compiler internals in IL generation, but for ordinary programmer this info is stumbling-stone.