-
Notifications
You must be signed in to change notification settings - Fork 7
allow better subclassing of Connection #133
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ abstract class Connection { | |
| * | ||
| * This should be the Hack class over which you want to paginate. | ||
| */ | ||
| <<__Enforceable>> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this need to be enforceable?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it's not enforceable I cannot do this in SqlConnection class
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don’t follow. Looking at that code you shared, |
||
| abstract const type TNode; | ||
|
|
||
| /** | ||
|
|
||
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.
Nice.
Should we get a test that this works? E.g., add a
FooConnectionabstract class subclassingConnection, and aBarConnectionconcrete class subclassingFooConnectionand annotated withObjectType?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.
hmm yeah not really sure where/ how to add this to a test? I added a fixture with sublcassing, but what file do I test it in?
Uh oh!
There was an error while loading. Please reload this page.
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.
Just checking that the codegen looks correct should be fine!
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.
hmm how do I do that? sorry not familiar with out this sort of testing works
Uh oh!
There was an error while loading. Please reload this page.
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.
Basically:
tests/Fixtures.make test. This will do the codegen.FooConnectionand a concreteBarConnection, we should end up with one generated class in aBarConnection.hack.Also happy to pair!
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.
You also have failing tests... we'll need to annotate
UserConnection.hackwith theObjectTypeattribute, and ideally look at that attribute inGenerator::getConnectionObjects. Again, happy to pair.