Skip to content

Commit ce79e69

Browse files
committed
compiler: private properties in an interface are an error
It does not make sense to declare an interface with properties that are not accessible to the user of the interface.
1 parent ab1060d commit ce79e69

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/compiler/object_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ impl Element {
12811281
});
12821282

12831283
if base_type == ElementType::Interface && visibility == PropertyVisibility::Private {
1284-
diag.push_warning(
1284+
diag.push_error(
12851285
"'private' properties are inaccessible in an interface".into(),
12861286
&prop_decl,
12871287
);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
export interface ValidInterfacePropertyDeclarations {
55
property <bool> implicit-private;
6-
// ^warning{'private' properties are inaccessible in an interface}
6+
// ^error{'private' properties are inaccessible in an interface}
77

88
private property <int> private;
9-
// ^warning{'private' properties are inaccessible in an interface}
9+
// ^error{'private' properties are inaccessible in an interface}
1010

1111
in property <int> in-property;
1212
out property <string> out-property;

0 commit comments

Comments
 (0)