D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7731 - Assertion failure: 't' on line 7911 in file 'mtype.c'
Summary: Assertion failure: 't' on line 7911 in file 'mtype.c'
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2012-03-19 06:27 UTC by Dmitry Olshansky
Modified: 2012-03-24 22:26 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 Dmitry Olshansky 2012-03-19 06:27:50 UTC
That's the exact output of dmd 2.059head, on win 7:                 
Assertion failure: 't' on line 7911 in file 'mtype.c'

abnormal program termination

//code
struct A{
  int a;
}

template Inherit(alias X)
{
  X __super;
  alias __super this;
}

struct B{
  mixin Inherit!A;
  int b;
}

struct PolyPtr(X)
{
	X* _payload;
	static if(is(typeof(X.init.__super)))
	{
		alias typeof(X.init.__super) Super;
		@property auto getSuper(){ return PolyPtr!Super(&_payload.__super); }
		alias getSuper this;
	}
//	alias _payload this;//multiple alias this, sigh
	auto opDispatch(string s)(){ return mixin("_payload."~s); }
}

template create(X) 
{
	PolyPtr!X create(X, T...)(T args){
		return PolyPtr!X(args);
	}	
}

void f1(PolyPtr!A a) {/*...*/}
void f2(PolyPtr!B b) {f1(b);/*...*/}

void main(){
	auto b = create!B();
}
Comment 2 github-bugzilla 2012-03-24 21:17:50 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/daeed10cdda3bf21e697002944ed09e56cad76b3
Merge pull request #833 from 9rnsr/fix7731

Issue 7731 - Assertion failure: 't' on line 7911 in file 'mtype.c'