D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7895 - Internal compiler error
Summary: Internal compiler error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-12 16:46 UTC by Manu
Modified: 2012-04-21 11:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2012-04-12 16:46:26 UTC
module remedy.math.matrix;

struct Vector4
{
	float x = 0.0f;
	float y = 0.0f;
	float z = 0.0f;
	float w = 0.0f;

	static immutable zero =		Vector4( 0.0f, 0.0f, 0.0f, 0.0f );
	static immutable one =		Vector4( 1.0f, 1.0f, 1.0f, 1.0f );
	static immutable right =	Vector4( 1.0f, 0.0f, 0.0f, 0.0f );
	static immutable up =		Vector4( 0.0f, 1.0f, 0.0f, 0.0f );
	static immutable forward =	Vector4( 0.0f, 0.0f, 1.0f, 0.0f );
	static immutable origin =	Vector4( 0.0f, 0.0f, 0.0f, 0.0f );
	static immutable identity =	Vector4( 0.0f, 0.0f, 0.0f, 1.0f );
}

struct Matrix4
{
	union
	{
		struct
		{
			Vector4 x = Vector4.right;
			Vector4 y = Vector4.up;
			Vector4 z = Vector4.forward;
			Vector4 t = Vector4.zero;
		}
		float[16] m;
		Vector4[4] v;
	}

	static immutable Matrix4 identity = Matrix4.init;
}



The final line causes the error:
  static immutable Matrix4 identity = Matrix4.init;

Remove the initialisation ( = Matrix4.init), and it works fine.
Comment 1 SomeDude 2012-04-21 11:27:42 UTC
This compiles fine on dmd 2.059 Win32.
Comment 2 Manu 2012-04-21 11:40:09 UTC
So it does. Resolved :)