rorm icon indicating copy to clipboard operation
rorm copied to clipboard

Using `Self` as part of a model's field's type produces wrong code

Open gammelalf opened this issue 1 year ago • 0 comments

When generating the unit struct for a field, rorm uses the type specified in its model to populate the Field::Type associated type:

struct SomeModel {
    id: Id<Self>,
}

impl Field for __SomeModel_id {
    // "Self" now uses the wrong type (It should be SomeModel but is __SomeModel_id)
    type Type = Id<Self>;
}

gammelalf avatar May 17 '24 09:05 gammelalf