[Issue 10076] expression.c:4310: virtual Expression* TypeExp::semantic(Scope*): Assertion `0' failed.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 13 23:27:47 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10076



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2013-05-13 23:27:46 PDT ---
> Here's a dustmine reduced testcase. Run with `dmd -unittest`.

Thanks.

AFAICS This is a regreession from 2.060. This reduced code
(Use old alias syntax):

void main()
{
    string s;
    validate(s);
}
template getValidaterAttrs(T)
{
    alias getMembersAndAttributesWhere!().Elements getValidaterAttrs;
}
void validate(T)(T)
{
    alias getValidaterAttrs!T memberAttrs;
    auto x = memberAttrs.length;
}

Fails without assertion in 2.059:

test.d(8): Error: template instance getMembersAndAttributesWhere!() template
'getMembersAndAttributesWhere' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(12): Error: template instance test.getValidaterAttrs!(string) error
instantiating
test.d(4):        instantiated from here: validate!(string)
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(12): Error: forward reference to
'getMembersAndAttributesWhere!().Elements'
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(12): Error: forward reference to
'getMembersAndAttributesWhere!().Elements'
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(13): Error: forward reference to
'getMembersAndAttributesWhere!().Elements'
test.d(13): Error: getValidaterAttrs!(string) is used as a type
test.d(4): Error: template instance test.validate!(string) error instantiating


But cause an ice in 2.060:

test.d(8): Error: template instance getMembersAndAttributesWhere!() template
'getMembersAndAttributesWhere' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(12): Error: template instance test.getValidaterAttrs!(string) error
instantiating
test.d(4):        instantiated from here: validate!(string)
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(12): Error: forward reference to
'getMembersAndAttributesWhere!().Elements'
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(12): Error: forward reference to
'getMembersAndAttributesWhere!().Elements'
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(8): Error: identifier 'Elements' of
'getMembersAndAttributesWhere!().Elements' is not defined
test.d(13): Error: forward reference to
'getMembersAndAttributesWhere!().Elements'
Assertion failure: '0' on line 4216 in file 'expression.c'

abnormal program termination

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list