www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12070] New: Variant opCall not static

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

           Summary: Variant opCall not static
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: Jesse.K.Phillips+D gmail.com



13:17:12 PST ---
In previous versions the following code compiled because there was no opCall:

import std.variant;

void main() {
    auto v = Variant();
}

Error: need 'this' for 'opCall' of type ' trusted VariantN!(20u)()'

The opCall isn't static so it requires a this. A work around seems to be to add
null:

Variant(null);

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 03 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12070


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
          Component|Phobos                      |DMD



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

I think the issue has come from a not useful language behavior. So I change
"Component" field to "DMD".

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12070




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

https://github.com/D-Programming-Language/dmd/commit/7eaeac6759081c45da3dba4902cd932416e29281
fix Issue 12070 - Variant opCall not static

If both constructor and opCall exist, `Type()` should be handled as literal
syntax for default construction.

https://github.com/D-Programming-Language/dmd/commit/231e27f036ba086c42339bbae966e93c2b71cd61


[REG2.065a] Issue 12070 - Variant opCall not static

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12070


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: -------
Feb 06 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12070




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

https://github.com/D-Programming-Language/dmd/commit/6ec6c31d207e786071190b3a5e3ea4359fb631b7


[REG2.065a] Issue 12070 - Variant opCall not static

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