[Issue 6688] New: An struct that has @disable constructor does not work with template constraint

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 17 21:13:57 PDT 2011


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 at puremagic.com
        ReportedBy: repeatedly at gmail.com


--- Comment #0 from Masahiro Nakagawa <repeatedly at gmail.com> 2011-09-17 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: -------


More information about the Digitalmars-d-bugs mailing list