www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6688] New: An struct that has disable constructor does not work with template constraint

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

           Summary: An struct that has  disable constructor does not work
                    with template constraint
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: repeatedly gmail.com



21:13:34 PDT ---
Following code causes compilation error in dmd 2.055.

code:
-----
struct S
{
     disable this();
    this(int a) {}
}

S s = S(10);
writeln(s);
-----

output:
-----
/path/to/phobos/std/stdio.d(1483): Error: variable std.stdio.writeln(T...) if
(T.length == 0).writeln._args_field_0 initializer required for type S
/path/to/phobos/std/stdio.d(1495): Error: variable std.stdio.writeln(T...) if
(T.length == 1 && is(typeof(args[0]) : const(char)[])).writeln._args_field_0
initializer required for type S
/path/to/phobos/std/stdio.d(1508): Error: variable std.stdio.writeln(T...) if
(T.length > 1 || T.length == 1 && !is(typeof(args[0]) :
const(char)[])).writeln._args_field_0 initializer required for type S
-----

I think this is a regression.

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




This issue will be fixed by dmd/pull/286 as a side effect.
https://github.com/D-Programming-Language/dmd/pull/285

That patch applies STCparameter to function parameters correctly inside
template constraint, then errors are suppressed.

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


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

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



https://github.com/D-Programming-Language/dmd/commit/91debf464f8b6c49a0d522d10fce285ad1a5f9e7

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