Compiler error on struct with invariant and postblitz

Alex Khmara alex.khmara at gmail.com
Sat Jan 1 11:17:36 PST 2011


Please help: is it compiler bug or I'm doing something wrong?

This code:

module properties;

struct PropertyList {
<-->invariant() {
<--><-->assert(1);
<-->}

<-->this(this) {
<--><-->_props = [];
<-->}

<-->string[] _props;
}


gives compiler error:

Error: __result = this is not mutable
Error: __result = this is not an lvalue

Without invariant all works good.


More information about the Digitalmars-d-learn mailing list