Thread overview
Is it bug compiler?
May 12, 2016
MGW
May 12, 2016
Vladimir Panteleev
May 12, 2016
Windows 7 32bit
-----------------------
import std.stdio;
import std.conv;

class CFormaMain {
 	~this() {
		char[] zz = [ 'A', 'B', 'C' ];
		writeln(to!string(zz));
	}
}

int main(string[] args) {
 	CFormaMain formaMain;
	formaMain = new CFormaMain();
	return 0;
}
-----------------------
core.exception.InvalidMemoryOperationError@src\core\exception.d(693): Invalid me
mory operation


May 12, 2016
On 5/12/16 9:20 AM, MGW wrote:
> Windows 7 32bit
> -----------------------
> import std.stdio;
> import std.conv;
>
> class CFormaMain {
>       ~this() {
>          char[] zz = [ 'A', 'B', 'C' ];

This allocates. Allocations are not allowed in GC collection cycle.

-Steve
May 12, 2016
On Thursday, 12 May 2016 at 13:20:35 UTC, MGW wrote:
> Windows 7 32bit
> -----------------------
> import std.stdio;
> import std.conv;
>
> class CFormaMain {
>  	~this() {
> 		char[] zz = [ 'A', 'B', 'C' ];
> 		writeln(to!string(zz));
> 	}
> }
>
> int main(string[] args) {
>  	CFormaMain formaMain;
> 	formaMain = new CFormaMain();
> 	return 0;
> }
> -----------------------
> core.exception.InvalidMemoryOperationError@src\core\exception.d(693): Invalid me
> mory operation

No. Look at the documentation of InvalidMemoryOperationError.