dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Implicit Conversion of Template Instantiations

Open WalterBright opened this issue 1 year ago • 3 comments

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

WalterBright avatar Mar 16 '24 05:03 WalterBright

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"

dlang-bot avatar Mar 16 '24 05:03 dlang-bot

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)`

WalterBright avatar Mar 16 '24 05:03 WalterBright

Blocked by https://github.com/dlang/phobos/pull/8950

WalterBright avatar Mar 18 '24 16:03 WalterBright