Skip to content

Forward private base references used as property defaults - #12865

Open
R-Cramer4 wants to merge 2 commits into
slint-ui:masterfrom
R-Cramer4:1461-fix
Open

Forward private base references used as property defaults#12865
R-Cramer4 wants to merge 2 commits into
slint-ui:masterfrom
R-Cramer4:1461-fix

Conversation

@R-Cramer4

Copy link
Copy Markdown
Contributor

Closes #1461

This fix creates a new property on the base element during lowering so it can be accessed by other elements

@R-Cramer4 R-Cramer4 changed the title forward private base references used as property defaults Forward private base references used as property defaults Aug 11, 2026

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever to create a property that alias the original.

This will show up in errors such as the binding loop error, but i guess this is fine as it is a corner case.

@LeonMatthes will that also help for the debug hook to have debug hook on property that don't have a binding in the component itself but have a binding in the element?

@ogoffart

Copy link
Copy Markdown
Member

(An alternative implementation could be to have an extra property for the "base" case, but not sure it is a nicer implementenation)

@LeonMatthes

Copy link
Copy Markdown
Member

@LeonMatthes will that also help for the debug hook to have debug hook on property that don't have a binding in the component itself but have a binding in the element?

I don't think so. We don't debug hook the base component of the elements anyway, only the root components elements.
So this doesn't really change anything for the debug hooks.

@LeonMatthes

LeonMatthes commented Aug 13, 2026

Copy link
Copy Markdown
Member

@LeonMatthes will that also help for the debug hook to have debug hook on property that don't have a binding in the component itself but have a binding in the element?

Ah, actually, I think I know what you were getting at. We could use the same mechanism for injecting debug hooks that references something from the base component.
Good point indeed, yes that sounds possible and would allow us to disable the full inlining that debug hooks currently rely on 🤔

On the other hand, how difficult do you think it would be to make the NamedReference actually resolvable within derived elements? As that would fix the issue at the source.

But in any case, if we merge this PR as-is, I'll try to move the debug hooks over to this as well.

@ogoffart

Copy link
Copy Markdown
Member

On the other hand, how difficult do you think it would be to make the NamedReference actually resolvable within derived elements? As that would fix the issue at the source.

I think more difficult. But that would also be a fix for #12881

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

Successfully merging this pull request may close these issues.

Compiler unable to represent state property binding when the default binding is declared in a different component

3 participants