language: Add cast expressions

This commit is contained in:
James Westman 2022-12-23 23:24:29 -06:00
parent 2033bd9e16
commit 5cf9b63547
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
15 changed files with 122 additions and 20 deletions

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
Overlay overlay {
margin-bottom: bind overlay.child as (Adjustment).value;
}

View file

@ -0,0 +1 @@
4,37,15,Invalid cast. No instance of Gtk.Widget can be an instance of Gtk.Adjustment.

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
Overlay overlay {
margin-bottom: bind overlay.child as (Label).not-a-property;
}

View file

@ -0,0 +1 @@
4,48,14,Gtk.Label does not have a property called not-a-property

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
Overlay overlay {
margin-bottom: bind overlay.margin-bottom.what;
}

View file

@ -0,0 +1 @@
4,45,4,Type int does not have properties

View file

@ -1 +1 @@
4,3,19,Class Gtk.Label does not contain a property called not-a-real-property
4,3,19,Class Gtk.Label does not have a property called not-a-real-property

View file

@ -5,5 +5,5 @@ Overlay {
}
Label {
label: bind (label.parent).child.label;
label: bind (label.parent) as (Overlay).child as (Label).label;
}

View file

@ -8,9 +8,9 @@
</object>
<object class="GtkLabel">
<binding name="label">
<lookup name="label">
<lookup name="child">
<lookup name="parent">
<lookup name="label" type="GtkLabel">
<lookup name="child" type="GtkOverlay">
<lookup name="parent" type="GtkLabel">
<constant>label</constant>
</lookup>
</lookup>

View file

@ -151,7 +151,7 @@ class TestSamples(unittest.TestCase):
self.assert_sample("combo_box_text")
self.assert_sample("comments")
self.assert_sample("enum")
self.assert_sample("expr_lookup", skip_run=True) # TODO: Fix
self.assert_sample("expr_lookup")
self.assert_sample("file_filter")
self.assert_sample("flags")
self.assert_sample("id_prop")
@ -207,6 +207,9 @@ class TestSamples(unittest.TestCase):
self.assert_sample_error("duplicates")
self.assert_sample_error("empty")
self.assert_sample_error("enum_member_dne")
self.assert_sample_error("expr_cast_conversion")
self.assert_sample_error("expr_lookup_dne")
self.assert_sample_error("expr_lookup_no_properties")
self.assert_sample_error("filters_in_non_file_filter")
self.assert_sample_error("gtk_3")
self.assert_sample_error("gtk_exact_version")