-
Notifications
You must be signed in to change notification settings - Fork 43
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 NRE when printing directive without locations #300
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #300 +/- ##
=======================================
Coverage 99.82% 99.82%
=======================================
Files 85 85
Lines 4540 4547 +7
Branches 459 461 +2
=======================================
+ Hits 4532 4539 +7
Misses 6 6
Partials 2 2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The real problem is that we have = null!;
as the property initializer, which we should not if we are exposing the class publicly.
I can argue. |
I mean any property in AST node may be uninialized now if constructed manually. Parser throws exception if locations not set into parsed text. |
Right but what I mean is that we should have a constructor which requires a value and remove the default constructor, in order for the NRT attributes to be accurate always. Then “= null!” is not required. Or, make the default constructors internal. Certainly the NRT attributes are correct as-is to match the AST parsing. |
It will force us to switch the order of nodes creation from "parent, then child" to "child, then parent" and |
Internally we can still do it the other way. But the |
Understood. |
Edge case in tests for https://github.com/sungam3r/graphql-introspection-model