-
Notifications
You must be signed in to change notification settings - Fork 0
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
Extractor v2 #21
base: main
Are you sure you want to change the base?
Extractor v2 #21
Conversation
@@ -535,35 +536,35 @@ type Poseidon1 struct { | |||
In frontend.Variable | |||
} | |||
|
|||
func (g Poseidon1) DefineGadget(api abstractor.API) []frontend.Variable { | |||
func (g Poseidon1) DefineGadget(api frontend.API) interface{} { |
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.
why not frontend.Variable
anymore?
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.
Because we try to describe an interface which can return a single frontend.Variable
or n-nested slices of frontend.Variable
. interface{}
is vanilla for everything. The user needs to know what to expect.
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.
right, but you can declare the return value as []frontend.Variable
for the implementation and it still works with the interface, no?
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.
I.e. I understand why API
has interface{}
but not why the impl has it
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.
Because golang is strict and complains does not implement abstractor.GadgetDefinition
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.
can we use generics for this?
Summary
Details
Checklist