Bug 11767 – doubly mixed-in struct "failed semantic analysis"

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-18T15:36:00Z
Last change time
2014-01-15T09:44:48Z
Keywords
accepts-invalid, diagnostic, ice, pull, rejects-valid
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2013-12-18T15:36:46Z
Spin-off of bug 11718, comment 1. The original test case and reduced version are fixed, so this seems to be another issue. --- cat > test.d << code mixin template M() { struct S {} } mixin M!(); mixin M!(); alias S T; /* should generate an error about conflicting symbols */ code echo "2.git:"; /home/nils/d/dmd2.git/dmd2/linux/bin64/dmd -c test.d echo "2.064.2:"; /home/nils/d/dmd2.064.2/dmd2/linux/bin64/dmd -c test.d echo "2.063.2:"; /home/nils/d/dmd2.063.2/dmd2/linux/bin64/dmd -c test.d echo "2.062:"; /home/nils/d/dmd2.062/dmd2/linux/bin64/dmd -c test.d echo "2.061:"; /home/nils/d/dmd2.061/dmd2/linux/bin64/dmd -c test.d echo "2.060:"; /home/nils/d/dmd2.060/dmd2/linux/bin64/dmd -c test.d echo "2.059:"; /home/nils/d/dmd2.059/dmd2/linux/bin64/dmd -c test.d --- 2.git: test.d(3): Error: struct test.M!().S failed semantic analysis test.d(6): Error: mixin test.M!() error instantiating test.d(7): Error: test.M!().S at test.d(3) conflicts with test.M!().S at test.d(3) test.d(7): Error: test.M!().S at test.d(3) conflicts with test.M!().S at test.d(3) 2.064.2: test.d(3): Error: struct test.M!().S failed semantic analysis test.d(6): Error: mixin test.M!() error instantiating test.d(7): Error: test.M!().S at test.d(3) conflicts with test.M!().S at test.d(3) test.d(7): Error: test.M!().S at test.d(3) conflicts with test.M!().S at test.d(3) 2.063.2: dmd: struct.c:741: virtual void StructDeclaration::semantic(Scope*): Assertion `type->ty != Tstruct || ((TypeStruct *)type)->sym == this' failed. Aborted (core dumped) 2.062: 2.061: 2.060: 2.059: test.d(7): Error: test.M!().S at test.d(3) conflicts with test.M!().S at test.d(3) --- 2.059's behaviour is the correct one, as far as I can tell.
Comment #1 by k.hara.pg — 2013-12-23T21:06:07Z
Comment #2 by github-bugzilla — 2013-12-25T23:58:55Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e8b3503cf48f225569697a7603ad8769ef8942ac fix Issue 11767 - doubly mixed-in struct "failed semantic analysis" Inherently this is a mangling issue, which had been hidden since 2a3db5d7afd0c26e8a0ec58ff6fb6a8cd9647de6, and then detected by [the assertion for AST sanity](20fe5e8600498fed322a7d5d8305acb2de852cde). Each mixed-in symbols are in independent scope, and their mangled names should also be different. To fix the issue, assign scope-local unique name for each unnamed `TemplateMixin`s, as same as lambdas. https://github.com/D-Programming-Language/dmd/commit/4369b6d85b5cf4516af00c60796557028d4bee2d Merge pull request #3019 from 9rnsr/fix11767 [REG2.060] Issue 11767 - doubly mixed-in struct "failed semantic analysis"
Comment #3 by github-bugzilla — 2013-12-31T04:13:39Z
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0a9822e1b021c8607d53aee5af9e12edf32c5a37 Merge pull request #3019 from 9rnsr/fix11767 [REG2.060] Issue 11767 - doubly mixed-in struct "failed semantic analysis"
Comment #4 by github-bugzilla — 2014-01-15T09:44:48Z