July 02, 2017 [Issue 8570] Tuples without named fields should implicitly convert to tuples with named fields when returned from a function | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=8570 Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |dlang-bugzilla@thecybershad | |ow.net Resolution|--- |WONTFIX --- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> --- Reduced: struct S { this(int) {} } void bar() { S s = 5; } S foo() { return 5; } The first is an initialization / assignment; the second is an implicit conversion. Currently D does not allow defining implicit conversions to arbitrary types (closest is alias this, but it can alias only specific types). Providing some way for types to do implicit conversions to arbitrary other types is a much bigger discussion outside of the scope of this issue. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply