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

swift4 support #26

Closed
Igor-Palaguta opened this issue Sep 18, 2017 · 16 comments
Closed

swift4 support #26

Igor-Palaguta opened this issue Sep 18, 2017 · 16 comments

Comments

@Igor-Palaguta
Copy link
Contributor

Hello,

Thank you for great library! It works perfectly

Do you have in nearest plans migrate it to swift 4. With few fixes it can be compiled with swift4, but testIntrospectionCharacterKindQuery fails with EXC_BAD_ACCESS here:

return unsafeBitCast(self, to: Any.self)

@johntaschereau
Copy link

Please allow me to bump-up and add my voice to this request. This outstanding project (from a utility and educational perspective) hasn't worked due to the use of unsafeBitCast with Swift 4. I attempted to fix using Mike Ash's excellent article "Swift Unmanaged" (https://mikeash.com/pyblog/friday-qa-2017-08-11-swiftunmanaged.html) but without success this far. Thank you.

@paulofaria
Copy link
Member

paulofaria commented Sep 18, 2017

@bradhilton Brad! Do you have any idea how to fix this?

@johntaschereau
Copy link

Mike Ash's August 2017 article "Swift Unmanaged" has a very clear paragraph at the onset: "The first task is converting a reference into the raw bytes for a void *, or converting the raw bytes of a void * back to a reference. Since Swift references are implemented as pointers, this is straightforward. It's really just a matter of getting the type system to cooperate. You can do this with unsafeBitCast, although I strongly recommend against it. If these details ever changed, you'd be in trouble, whereas Unmanaged will continue to work." … His article then goes on to explain how to use updated Swift and avoid UnsafeBitCast. I believe this article is the blueprint for addressing this issue in GraphQL. Mr. Palaguta's work appears outstanding however with the protocols and such, I wasn't clear enough given the time I had to see about replacing UnsafeBitCast with Mike Ash's tips. I believe it can be done. I thought I would ask Mr. Palaguta and did when the Issue opened because he knows his software best. I remain convinced the article I cite by Mr. Ash can be used to effect the requisite changes.

@bradhilton
Copy link

bradhilton commented Sep 19, 2017

@Igor-Palaguta @johntaschereau @paulofaria I'm going to push an new build of Reflection supporting Swift 4 shortly

EDIT: Just pushed new build 0.15.0 that supports Swift 4

@paulofaria
Copy link
Member

@Igor-Palaguta are you willing to send a PR updating GraphQL's Reflection module with https://github.com/Zewo/Reflection?

@jseibert
Copy link
Contributor

Any progress here? Let me know what I can do to be helpful.

@paulofaria
Copy link
Member

@jseibert I believe the only thing needed it to pull the code from https://github.com/Zewo/Reflection and update GraphQL's Reflection module

@paulofaria
Copy link
Member

@jseibert if you can send a PR that would be very helpful! 😊

@jseibert
Copy link
Contributor

jseibert commented Oct 1, 2017

#27

@Igor-Palaguta I incorporated your changes as well. All tests now pass.

@paulofaria
Copy link
Member

fixed by #27

@jseibert
Copy link
Contributor

jseibert commented Oct 3, 2017

@paulofaria can we get a new release that ships this?

@paulofaria
Copy link
Member

@jseibert of course! sorry I forgot to release.

@paulofaria
Copy link
Member

@jseibert
Copy link
Contributor

jseibert commented Oct 3, 2017

Wow, you're fast! Awesome, thanks!

@jseibert
Copy link
Contributor

jseibert commented Oct 3, 2017

@paulofaria just opened a PR on Graphiti as well for you.

@lightwave
Copy link

Is the reason to keep those deprecated usage of String.characters around in the code base to maintain backward compatibility with Swift 3?

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

No branches or pull requests

6 participants