Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/issue 20756 implicitconversiontargets interfaces #7453

Conversation

FeepingCreature
Copy link
Contributor

Repro:

interface A { }
interface B : A { }

static assert(is(ImplicitConversionTargets!B == AliasSeq!(A)));

Expected: AliasSeq!(A)

Got: AliasSeq!()

@dlang-bot
Copy link
Contributor

dlang-bot commented Apr 21, 2020

Thanks for your pull request and interest in making D better, @FeepingCreature! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
20756 enhancement ImplicitConversionTargets ignores interface inheritance

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 + phobos#7453"

@FeepingCreature FeepingCreature force-pushed the fix/issue-20756-implicitconversiontargets-interfaces branch from 221109b to b6d92ed Compare April 21, 2020 11:45
@FeepingCreature
Copy link
Contributor Author

I'm a bit worried that the docs explicitly call out "a class derived from Object". Does supporting interfaces break anything?

@thewilsonator
Copy link
Contributor

If you're changing the docs, you should clarify if it works with extern(C++)/extern(Objective-C) classes or not.

@FeepingCreature
Copy link
Contributor Author

I cannot think of any reason why it wouldn't, but I don't know anything about C++ classes/interfaces and their D binding. Who could I ping about that?

@thewilsonator
Copy link
Contributor

Sorry I missed this. Probably @jacob-carlborg and/or @Geod24

@jacob-carlborg
Copy link
Contributor

I guess the above example should work for for C++ and Objective-C interfaces. But keep in mind they don't inherit from Object.

There are also COM interfaces, which I don't know how they behave.

Ideally there should be tests for all kinds. Although Objective-C interfaces are deprecated.

@n8sh n8sh added Enhancement and removed Bug Fix labels May 24, 2020
@RazvanN7
Copy link
Collaborator

ping @FeepingCreature . What is the status of this?

@FeepingCreature FeepingCreature force-pushed the fix/issue-20756-implicitconversiontargets-interfaces branch from 85fe3c4 to a286d99 Compare April 21, 2021 10:54
@FeepingCreature
Copy link
Contributor Author

Rebased, but note that I don't remember what I needed this for.

@FeepingCreature
Copy link
Contributor Author

FeepingCreature commented Apr 27, 2021

Actually, can't this definitely be closed? Looking at the changelog, we have AllImplicitConversionTargets now, and that handles interfaces just fine.

edit: Ah shit, it doesn't. I'll make a separate PR before that's released, so we don't make a new template with the exact same issue...

@FeepingCreature FeepingCreature deleted the fix/issue-20756-implicitconversiontargets-interfaces branch August 17, 2021 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants