[Issue 5747] cannot cast away shared if opCast defined

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 10 17:35:00 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=5747



--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> 2013-12-10 17:34:52 PST ---
I'm still not sure about this bug, because special handling for the
_qualifier-only-different cast_ could cause opposite problem in generic code.

template X(T, U) {
  ...
  T foo() { ... }
  auto u = cast(U)foo();
  // if U is different qualifier of T, it won't call opCast.
  // I don't think it is *always* valid behavior. It depends on the T's
definition.
}

I posted a spin-off issue:
Issue 11722 - Qualifier-only casts should not invoke opCast

To me, special handing only for the qualifier casts is more acceptable than
this.
How about?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list