diff --git a/docs/langref.md b/docs/langref.md index c29df4423..255072a84 100644 --- a/docs/langref.md +++ b/docs/langref.md @@ -168,13 +168,13 @@ Example := Button { Using the `<=>` syntax, one can create two ways binding between properties. These properties are now linked together. The right hand side of the `<=>` must be a reference to a property of the same type. -The type can be omitted in a property declaration to have the type automatically infered. +The type can be omitted in a property declaration to have the type automatically inferred. ```60 Example := Window { property rect_color <=> r.background; - // it is allowed to omit the type to have it automatically infered + // it is allowed to omit the type to have it automatically inferred property rect_color2 <=> r.background; r:= Rectangle { width: parent.width; diff --git a/sixtyfps_compiler/langtype.rs b/sixtyfps_compiler/langtype.rs index 7dadf99a1..36247bdad 100644 --- a/sixtyfps_compiler/langtype.rs +++ b/sixtyfps_compiler/langtype.rs @@ -221,7 +221,7 @@ impl Type { | Self::Struct { .. } | Self::Array(_) | Self::Brush - | Self::Void // Void is not a valid type for property, but it is temporarily used for infered two ways bindings + | Self::Void // Void is not a valid type for property, but it is temporarily used for inferred two ways bindings ) } diff --git a/sixtyfps_compiler/passes/infer_aliases_types.rs b/sixtyfps_compiler/passes/infer_aliases_types.rs index 24ddc0a07..2a3b205f3 100644 --- a/sixtyfps_compiler/passes/infer_aliases_types.rs +++ b/sixtyfps_compiler/passes/infer_aliases_types.rs @@ -81,7 +81,7 @@ fn resolve_alias( lookup_ctx.component_scope = &scope; Expression::from_two_way_binding(node, &mut lookup_ctx) } - _ => panic!("The parser should make sure that the expression is "), + _ => panic!("There should be a Uncompiled expression at this point."), }; let mut ty = e.ty(); diff --git a/sixtyfps_compiler/passes/resolving.rs b/sixtyfps_compiler/passes/resolving.rs index dbcd9bd1e..307ace77f 100644 --- a/sixtyfps_compiler/passes/resolving.rs +++ b/sixtyfps_compiler/passes/resolving.rs @@ -65,6 +65,7 @@ fn resolve_expression( } SyntaxKind::TwoWayBinding => { if lookup_ctx.property_type == Type::Invalid { + // An attempt to resolve this already failed when trying to resolve the property type assert!(diag.has_error()); return; }