D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3920 - Assertion failure: '0' on line 10018 in file 'expression.c'
Summary: Assertion failure: '0' on line 10018 in file 'expression.c'
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2010-03-09 18:03 UTC by Aldo Nunez
Modified: 2014-02-15 02:43 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Aldo Nunez 2010-03-09 18:03:42 UTC
The error is in MulExp::semantic. It happens no matter if the multiplication expression is in a template. These are the combinations that fail:

IF / ifloat
IF / IF
ID / idouble
ID / ID
IR / ireal
IR / IR


Here's a sample:

import std.stdio;

typedef ifloat IF;
typedef idouble ID;
typedef ireal IR;

template PrintAddedType(X, Y)
{
	void PrintAddedType()
	{
		X x;
		Y y;
		writeln( typeid( x ), " ", typeid( y ), " ", typeid( x / y ) );
	}
}

template PrintAddedType(X)
{
	void PrintAddedType()
	{
/*
		PrintAddedType!(X, ifloat)();
		PrintAddedType!(X, idouble)();
		PrintAddedType!(X, ireal)();
*/
/*
		PrintAddedType!(X, IF)();
		PrintAddedType!(X, ID)();
		PrintAddedType!(X, IR)();
*/
	}
}

void main()
{
/*
	PrintAddedType!(IF)();
	PrintAddedType!(ID)();
	PrintAddedType!(IR)();
*/
	IR x;
	IR y;
	writeln( typeid( x ), " ", typeid( y ), " ", typeid( x / y ) );
}
Comment 1 Don 2010-03-10 23:56:41 UTC
The patch for bug 3919 fixes this one, too.
Comment 2 Walter Bright 2010-03-12 20:53:31 UTC
changeset 415
Comment 3 Don 2010-04-09 13:39:13 UTC
Fixed DMD1.058 and 2.043.