dmd
dmd copied to clipboard
Implicit Conversion of Template Instantiations
DIP proposal:
https://github.com/WalterBright/documents/blob/master/templatecast.md
Doesn't implement covariance of non-static member functions yet.
Will be talking about it at DConf:
https://dconf.org/2024/online/index.html#walterb
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#16314"
Looks like I was wrong that nobody would be relying on this behavior:
std\typecons.d(333): Error: static assert: `!__traits(compiles, delegate () nothrow @system
{
Unique!(Object) uo = cast(Unique!(Object))uc;
uo.~this();
}
)` is false
and, in vibe.d:
../../../.dub/packages/vibe-inet/1.0.0/vibe-inet/source/vibe/inet/url.d(99,7): Error: `vibe.inet.url.URL.__ctor` called with argument types `(string, typeof(null), int, GenericPath!(InetPathFormat))` matches both:
--
| ../../../.dub/packages/vibe-inet/1.0.0/vibe-inet/source/vibe/inet/url.d(84,2): `vibe.inet.url.URL.this(string schema, string host, ushort port, GenericPath!(InetPathFormat) path)`
| and:
| ../../../.dub/packages/vibe-inet/1.0.0/vibe-inet/source/vibe/inet/url.d(120,2): `vibe.inet.url.URL.this(string schema, string host, ushort port, GenericPath!(WindowsPathFormat) path)`
Blocked by https://github.com/dlang/phobos/pull/8950