diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-05-09 13:35:07 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-05-10 12:56:12 +0200 |
commit | 2ae1698832e81a0ca46da91d882373c93b4ae0e0 (patch) | |
tree | 87702e158361295517010507482d1a2b2d5c834c /tests/generics/floating-type-cast.vala | |
parent | c49d45a4e52d5a572ca6e10ecdd5c475eb768720 (diff) | |
download | vala-2ae1698832e81a0ca46da91d882373c93b4ae0e0.tar.gz |
vala: Transform cast from floating-type to boxed-type
Don't generate invalid c-code leading to "cannot convert to a pointer type"
Fixes https://gitlab.gnome.org/GNOME/vala/issues/991
Diffstat (limited to 'tests/generics/floating-type-cast.vala')
-rw-r--r-- | tests/generics/floating-type-cast.vala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/generics/floating-type-cast.vala b/tests/generics/floating-type-cast.vala new file mode 100644 index 000000000..9475a4219 --- /dev/null +++ b/tests/generics/floating-type-cast.vala @@ -0,0 +1,9 @@ +void foo<G,T> (G g, T t) { + assert ((float?) g == 23.0f); + assert ((double?) t == 42.0); +} + +void main () { + foo ((float?) 23.0f, (double?) 42.0); + foo<float?,double?> ((float?) 23.0f, (double?) 42.0); +} |