Skip to content
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

Properties macro should error if construct(-only) property has no setter #1499

Open
sdroege opened this issue Aug 31, 2024 · 0 comments
Open

Comments

@sdroege
Copy link
Member

sdroege commented Aug 31, 2024

#[property(get, construct_only, default = 20)]
pub comments_per_page: Cell<u32>,

Gives

(lemmings:240427): GLib-GObject-CRITICAL **: 21:27:44.640: validate_pspec_to_install: assertion 'pspec->flags & G_PARAM_WRITABLE' failed
thread 'main' panicked at /home/dell/Projects/lemmings/build/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/glib-0.20.1/src/object.rs:2420:13:
property 'comments-per-page' of type 'LemCommentsModel' not found

at runtime. Should probably simply detect and disallow that in the macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant