[vala] Mark return type of `as` operator as nullable



commit 9bb99ae85792f22c2a21317f0c0150e81a58f35b
Author: Jürg Billeter <j bitron ch>
Date:   Wed Mar 10 07:56:00 2010 +0100

    Mark return type of `as` operator as nullable
    
    Fixes bug 612382.

 vala/valacastexpression.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala
index 83b7f41..a17f09f 100644
--- a/vala/valacastexpression.vala
+++ b/vala/valacastexpression.vala
@@ -138,6 +138,10 @@ public class Vala.CastExpression : Expression {
 		value_type = type_reference;
 		value_type.value_owned = inner.value_type.value_owned;
 
+		if (is_silent_cast) {
+			value_type.nullable = true;
+		}
+
 		inner.target_type = inner.value_type.copy ();
 
 		return !error;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]