-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
We are relying on @generated and it may create some concerns when using this package (e.g., mauro3/Parameters.jl#50).
I think the biggest issue is that setproperties generates a function for different patch type (e.g., different combination or even ordering of the property names).
It would be nice to write setproperties based on constant-propagatable code (e.g., recursions) and avoid using @generated. However, the major obstacle is that fieldnames cannot be inferred. To workaround this, how about just use
@generated __fieldnames__(::Type{T}) where T = fieldnames(T)? We already use fieldnames inside @generated so this is not worse than the current situation.
Packages that controls struct definition like Parameters.jl can even define __fieldnames__ and constructorof to completely avoid @generated.
Metadata
Metadata
Assignees
Labels
No labels