Skip to content

java2swift: add non-optional-returning as function to JavaClassMacro #74

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

Merged
merged 6 commits into from
Oct 18, 2024

Conversation

AbdAlRahmanGad
Copy link
Contributor

closes #20

@ktoso
Copy link
Collaborator

ktoso commented Oct 15, 2024

Gave this another look, it's not right at all I think. Only the known to be safe target types should be non-optional. So we need to know which types the java type extends/implements and for those types generate the method.

@ktoso ktoso requested a review from DougGregor October 15, 2024 01:27
@ktoso ktoso changed the title add non-optional-returning as function to JavaClassMacro java2swift: add non-optional-returning as function to JavaClassMacro Oct 15, 2024
@ktoso ktoso self-requested a review October 17, 2024 03:19
 to `JavaClassMacro`

- enhance the docs
@ktoso
Copy link
Collaborator

ktoso commented Oct 18, 2024

Seems this actually passes on swift-PR-76905-1539 but is not happy with the nightly, needs some more work -- would you like to continue polishing this up so it passes CI @AbdAlRahmanGad ?

@AbdAlRahmanGad
Copy link
Contributor Author

Seems this actually passes on swift-PR-76905-1539 but is not happy with the nightly, needs some more work -- would you like to continue polishing this up so it passes CI @AbdAlRahmanGad ?

Of course!
I just read the failing tests and looks like it's because I need to chaange as to `as` in Macros.swift

@AbdAlRahmanGad AbdAlRahmanGad requested a review from ktoso October 18, 2024 07:27
@ktoso
Copy link
Collaborator

ktoso commented Oct 18, 2024

Cool, this is looking good now.

I'd love to see perhaps another PR where we take some type that inherits from some other class Alpha extends Base type and make sure that we get the as(Base.self) method as well.

@ktoso
Copy link
Collaborator

ktoso commented Oct 18, 2024

Thanks for your contrib!

@ktoso ktoso merged commit 9823301 into swiftlang:main Oct 18, 2024
11 checks passed
@AbdAlRahmanGad
Copy link
Contributor Author

Cool, this is looking good now.

I'd love to see perhaps another PR where we take some type that inherits from some other class Alpha extends Base type and make sure that we get the as(Base.self) method as well.

Could you please Guide me to where I should implement this?
Also, Is this to make sure our implementation works right? So we are going to add an example to test it?

@AbdAlRahmanGad
Copy link
Contributor Author

Thanks for your contrib!

You're welcome! Glad I could help.

@AbdAlRahmanGad AbdAlRahmanGad deleted the non-optional-as branch October 22, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create non-optional-returning as functions for superclasses/extended interfaces
3 participants