The following code compiles without issue. I would expect we should either fail to compile or report an error when initializing the type object. Compile error probably leads to better UX, as long as the compiler error is meaningful enough.
#[pyclass]
pub struct Object {
#[pyo3(get)]
x: u32,
}
#[pymethods]
impl Object {
#[getter]
fn x(&self) -> u32 {
self.x
}
}
The following code compiles without issue. I would expect we should either fail to compile or report an error when initializing the type object. Compile error probably leads to better UX, as long as the compiler error is meaningful enough.