Bug 12070 – Variant opCall not static

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-03T13:17:00Z
Last change time
2014-02-06T19:34:32Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
Jesse.K.Phillips+D

Comments

Comment #0 by Jesse.K.Phillips+D — 2014-02-03T13:17:12Z
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);
Comment #1 by k.hara.pg — 2014-02-05T23:07:41Z
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".
Comment #2 by github-bugzilla — 2014-02-06T15:45:18Z
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 Merge pull request #3221 from 9rnsr/fix12070 [REG2.065a] Issue 12070 - Variant opCall not static
Comment #3 by github-bugzilla — 2014-02-06T19:34:32Z
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6ec6c31d207e786071190b3a5e3ea4359fb631b7 Merge pull request #3221 from 9rnsr/fix12070 [REG2.065a] Issue 12070 - Variant opCall not static