www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11584] New: std.typecons.Typedef assigned from const

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

           Summary: std.typecons.Typedef assigned from const
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-11-23 12:23:17 PST ---
import std.typecons: Typedef;
void main() {
    alias T = Typedef!int;
    immutable T bar;
    T foo1 = bar; // OK
    T foo2;
    foo2 = bar; // Error
}


dmd 2.065alpha gives:


...\dmd2\src\phobos\std\typecons.d(3853): Error: cannot implicitly convert
expression (v) of type immutable(Typedef!(int, 0)) to int
test.d(7): Error: template instance std.typecons.Typedef!(int,
0).Typedef.Proxy!(Typedef_payload).opAssign!(Typedef!(int, 0),
immutable(Typedef!(int, 0))) error instantiating
test.d(7): Error: template std.typecons.Typedef!(int,
0).Typedef.Proxy!(Typedef_payload).opAssign does not match any function
template declaration. Candidates are:
...\dmd2\src\phobos\std\typecons.d(3853):        std.typecons.Typedef!(int,
0).Typedef.Proxy!(Typedef_payload).opAssign(this X, V)(auto ref V v) if (!is(V
== typeof(this)))
...\dmd2\src\phobos\std\typecons.d(3841):        std.typecons.Typedef!(int,
0).Typedef.Proxy!(Typedef_payload).opAssign(this X)(auto ref typeof(this) v)
test.d(7): Error: template std.typecons.Typedef!(int,
0).Typedef.Proxy!(Typedef_payload).opAssign(this X, V)(auto ref V v) if (!is(V
== typeof(this))) cannot deduce template function from argument types
!()(immutable(Typedef!(int, 0)))

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



--- Comment #1 from bearophile_hugs eml.cc 2013-11-23 14:19:53 PST ---
See also Issue 11584

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



--- Comment #2 from bearophile_hugs eml.cc 2013-11-23 14:20:25 PST ---
(In reply to comment #1)
 See also Issue 11584
Sorry, see also Issue 7737 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 23 2013