Bug 10076 – expression.c:4310: virtual Expression* TypeExp::semantic(Scope*): Assertion `0' failed.

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-05-13T13:54:00Z
Last change time
2013-05-14T19:19:46Z
Keywords
ice, pull
Assigned to
nobody
Creator
simendsjo

Comments

Comment #0 by simendsjo — 2013-05-13T13:54:46Z
Using dmd 2.062 on GNU/Linux Arch x64. Haven't tried other setups. Running dustmite now, but it looks like it might take a while. source/simendlib/validate.d(69): Error: template instance getMembersAndAttributesWhere!(string, isValidationAttr) getMembersAndAttributesWhere!(string, isValidationAttr) does not match template declaration getMembersAndAttributesWhere(alias T, alias Pred) source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(73): Error: template instance simendlib.validate.getValidaterAttrs!(string) error instantiating source/simendlib/validate.d(31): instantiated from here: validate!(string) source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(73): Error: forward reference to 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(73): Error: forward reference to 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(69): Error: identifier 'Elements' of 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' is not defined source/simendlib/validate.d(74): Error: forward reference to 'getMembersAndAttributesWhere!(string, isValidationAttr).Elements' dmd: expression.c:4310: virtual Expression* TypeExp::semantic(Scope*): Assertion `0' failed. Error: Build command failed with exit code -6
Comment #1 by k.hara.pg — 2013-05-13T17:09:20Z
Where is the test case?
Comment #2 by simendsjo — 2013-05-13T23:04:28Z
Here's a dustmine reduced testcase. Run with `dmd -unittest`. unittest { string s; validate(s); } template getValidaterAttrs(T) { alias getValidaterAttrs = getMembersAndAttributesWhere!().Elements; } string[] validate(T)(T ) { alias memberAttrs = getValidaterAttrs!T; if(!memberAttrs.length) return ; }
Comment #3 by k.hara.pg — 2013-05-13T23:27:46Z
> 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
Comment #4 by k.hara.pg — 2013-05-14T00:00:11Z
Comment #5 by github-bugzilla — 2013-05-14T01:08:12Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1de97706107f9d4cc71553915ef29f6f426fbf41 fix Issue 10076 - expression.c:4310: virtual Expression* TypeExp::semantic(Scope*): Assertion `0' failed. https://github.com/D-Programming-Language/dmd/commit/61bcb35cc9a0dd6377b5c17e07a1ea6cb7fb2f12 Merge pull request #2032 from 9rnsr/fix10076 [REG2.060] fix Issue 10076 - expression.c:4310: virtual Expression* TypeExp::semantic(Scope*): Assertion `0' failed.