slint/tests
Simon Hausmann 03bef6dba3 Fix casting with conditional expressions
The following scenario would fail compiling to C++ because we failed to
determine the return type of the conditional expression:

    Test := Rectangle {
        property<bool> condition;
        property<color> extra_color;
        color: condition ? root.extra_color : 4289374890;
    }

The type of the true branch would be color and the false branch would be
a float. Since they "disagree", ty() on the expression would return
Type::Invalid. This was temporarily worked around in the C++ generator
by always returning the type of the true branch, but that's wrong.

Instead this patch changes maybe_convert_to to apply the Cast expression
to the individual branches, placing the cast only to the numberic
literal and correcting the return value of ty() on the conditional
expression.
2020-06-11 13:38:24 +02:00
..
cases Fix casting with conditional expressions 2020-06-11 13:38:24 +02:00
driver Fix linking error in the tests 2020-06-10 19:53:06 +02:00
driver_lib Fix rebuild issues, part 10523 2020-06-09 13:08:59 +02:00
rustdriver Test framework: extract the cpp and rust snippets 2020-06-08 10:54:17 +02:00