Skip to content

Commit 52c7894

Browse files
committed
compiler: verify that the new implement keyword doesn't break existing uses
Verify that the new `implement` keyword doesn't break existing uses of the name "implement" for properties/callback/functions/etc.
1 parent 0608474 commit 52c7894

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

internal/compiler/tests/syntax/interfaces/interface_resolution.slint

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,43 @@ export component NoInterfaceName {
7272
// > <error{Unknown property implement}
7373
base := PlainComponent { }
7474
}
75+
76+
export component CallbackNamedImplement {
77+
callback implement();
78+
implement => { }
79+
}
80+
81+
export component CallbackWithParametersNamedImplement {
82+
callback implement(int);
83+
implement(i) => { }
84+
}
85+
86+
export component FunctionNamedImplement {
87+
pure public function implement() -> int { 42 }
88+
out property <int> foo: implement();
89+
}
90+
91+
component PropertyNamedImplement {
92+
in-out property <int> implement;
93+
}
94+
95+
export component ChildIdImplement {
96+
implement := PropertyNamedImplement {
97+
implement: 42;
98+
}
99+
}
100+
101+
export component TwoWayBindingToPropertyNamedImplement {
102+
in-out property <int> implement;
103+
implement <=> child.foo;
104+
105+
child := Rectangle {
106+
in-out property <int> foo;
107+
}
108+
}
109+
110+
component implement { }
111+
112+
export component UsesImplementComponent {
113+
implement { }
114+
}

0 commit comments

Comments
 (0)