www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7933] New: Illegal interaction of templates

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

           Summary: Illegal interaction of templates
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: maximzms gmail.com



PDT ---
Compiler version: DMD64 D Compiler v2.058 on 64-bit Linux

The following code causes compiler errors:

----------
struct Boo(size_t dim){int a;}
struct Baa(size_t dim){Boo!dim a;}
//struct Baa(size_t dim){Boo!1 a;} //(1) This version causes no errors

auto foo()(Boo!1 b){return b;}
//auto fuu(Boo!1 b){return b;} //(2) This line neutralizes the error

void main()
{
    Baa!1 a; //(3) This line causes the error message
    Baa!2 a1;
    auto b = foo(Boo!1(1));
}
----------

Error messages:

----------
test.d(12): Error: template test.foo() does not match any function template
declaration
test.d(12): Error: template test.foo() cannot deduce template function from
argument types !()(Boo!(1LU))
----------

These errors occure only if there is line markes as (3).

If the definition of `Baa` is changed with the one marked as (1) there is no
errors.

If there is line marked as (2) there is no errors (even though the function
`fuu` is not used anywhere).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 17 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7933


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7933




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

https://github.com/D-Programming-Language/dmd/commit/ec4041f49357544c1cb5406baf678efcaccae5bf
fix Issue 7933 - Illegal interaction of templates

https://github.com/D-Programming-Language/dmd/commit/6131069d0edb21ecf8eda55e088ab5c4b17a91aa


Issue 7933 - Illegal interaction of templates

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 18 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7933


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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