[Issue 17733] idup fails for structs/classes with member functions
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Aug 8 11:49:04 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17733
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |schveiguy at yahoo.com
Resolution|--- |INVALID
--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> ---
This is because in the first case, S has a hidden context pointer to the stack
frame of main().
If you mark it as a static struct, you will not have this problem.
Note that the ultimate reason it fails is because any items that have
indirections cannot be implicitly converted to immutable.
--
More information about the Digitalmars-d-bugs
mailing list