-
Notifications
You must be signed in to change notification settings - Fork 94
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
Issue with NominalMetadataType.genericArguments() #42
Comments
Not to sure whats going on off the top of my head. Ill take a look soon. Thanks for the test case! |
@sportlabsMike Not too sure why it being nested within a function is messing it up. If the nested struct was generic it would work. Ended up getting it to work by checking the metadata flags to make sure the type is generic before trying to read the arguments. I have a branch if you wouldn't mind testing it out: |
@wickwirew that |
Awesome thanks! Its been merged and |
Hi,
I've been trying to get the GraphQL related https://github.com/GraphQLSwift/Graphiti project upgraded to Swift5 using the latest version of this library and came across a crash running the tests. The crash occurs in NominalMetadataType.genericArguments() when trying to get the TypeInfo for a simple Struct. I noticed that the Struct was declared nested within a closure.
It appears that NominalMetadataType.genericArguments() is coming back with a non-zero size results when it ought to be zero, and sometimes crashes.
To try and reproduce the problem within this project directly I've added a new test to MetadataTests.swift called testNestedStruct.
Please see this branch on my fork https://github.com/SportlabsTechnology/Runtime/tree/investigateCrash
Weirdly the addition of this new test causes the existing testStruct test to detect a non-zero amount of genericArguments and fail.
Any ideas ands help appreciated.
Thanks,
Mike.
The text was updated successfully, but these errors were encountered: