www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11767] New: doubly mixed-in struct "failed semantic analysis"

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11767

           Summary: doubly mixed-in struct "failed semantic analysis"
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com



---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 18 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11767


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic, ice, pull,
                   |                            |rejects-valid
            Version|unspecified                 |D2



https://github.com/D-Programming-Language/dmd/pull/3019

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11767




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


[REG2.060] Issue 11767 - doubly mixed-in struct "failed semantic analysis"

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11767


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 26 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11767




Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0a9822e1b021c8607d53aee5af9e12edf32c5a37


[REG2.060] Issue 11767 - doubly mixed-in struct "failed semantic analysis"

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 31 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11767




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0a9822e1b021c8607d53aee5af9e12edf32c5a37


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