summaryrefslogtreecommitdiff
path: root/vala
diff options
context:
space:
mode:
Diffstat (limited to 'vala')
-rw-r--r--vala/valacastexpression.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala
index ef1637eaa..0dc7603c0 100644
--- a/vala/valacastexpression.vala
+++ b/vala/valacastexpression.vala
@@ -215,6 +215,10 @@ public class Vala.CastExpression : Expression {
&& is_gvalue (context, inner.value_type) && !is_gvalue (context, value_type)) {
// GValue unboxing returns unowned value
value_type.value_owned = false;
+ if (value_type.nullable && value_type.type_symbol != null && !value_type.type_symbol.is_reference_type ()) {
+ error = true;
+ Report.error (source_reference, "Casting of `GLib.Value' to `%s' is not supported".printf (value_type.to_qualified_string ()));
+ }
}
inner.target_type = inner.value_type.copy ();