summaryrefslogtreecommitdiff
path: root/tests/basic-types
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-04-01 14:02:55 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-04-01 14:05:27 +0200
commit792e9672a07fec8cbe4152789ad38c4304c8e266 (patch)
tree5fec9fd6beb642dc29ba8bde8d5c29f378ecc768 /tests/basic-types
parentc69b4866c342116c8cf7b3d5a839929acc50b065 (diff)
downloadvala-792e9672a07fec8cbe4152789ad38c4304c8e266.tar.gz
vala: Consider boolean types are compatible with each other
Diffstat (limited to 'tests/basic-types')
-rw-r--r--tests/basic-types/boolean.vala20
-rw-r--r--tests/basic-types/custom-types.vala3
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/basic-types/boolean.vala b/tests/basic-types/boolean.vala
new file mode 100644
index 000000000..1e6c04fb3
--- /dev/null
+++ b/tests/basic-types/boolean.vala
@@ -0,0 +1,20 @@
+[SimpleType]
+[BooleanType]
+public struct Foo {
+ public void check () {
+ if (this) {
+ return;
+ }
+ assert (true);
+ }
+}
+
+void main () {
+ Foo foo = true;
+
+ foo.check ();
+
+ if (!foo) {
+ assert (true);
+ }
+}
diff --git a/tests/basic-types/custom-types.vala b/tests/basic-types/custom-types.vala
index d979a9beb..e8aa5d727 100644
--- a/tests/basic-types/custom-types.vala
+++ b/tests/basic-types/custom-types.vala
@@ -46,6 +46,7 @@ void main () {
assert (baz == double.MAX);
}
{
- manam_t manam;
+ manam_t manam = true;
+ assert (manam);
}
}