+2009-01-10 Jürg Billeter <j@bitron.ch>
+
+ * vala/valacodecontext.vala:
+ * vala/valaformalparameter.vala:
+ * vala/valareturnstatement.vala:
+ * vala/valasemanticanalyzer.vala:
+ * gobject/valaccodemethodmodule.vala:
+ * compiler/valacompiler.vala:
+
+ Remove --disable-non-null option after transition period
+ of 9 months
+
2009-01-10 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala:
static bool thread;
static bool disable_assert;
static bool enable_checking;
- static bool disable_non_null;
static bool non_null_experimental;
static bool disable_dbus_transformation;
static string cc_command;
{ "thread", 0, 0, OptionArg.NONE, ref thread, "Enable multithreading support", null },
{ "disable-assert", 0, 0, OptionArg.NONE, ref disable_assert, "Disable assertions", null },
{ "enable-checking", 0, 0, OptionArg.NONE, ref enable_checking, "Enable additional run-time checks", null },
- { "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null },
{ "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, "Enable experimental enhancements for non-null types", null },
{ "disable-dbus-transformation", 0, 0, OptionArg.NONE, ref disable_dbus_transformation, "Disable transformation of D-Bus member names", null },
{ "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
context.library = library;
context.assert = !disable_assert;
context.checking = enable_checking;
- context.non_null = !disable_non_null || non_null_experimental;
context.non_null_experimental = non_null_experimental;
context.dbus_transformation = !disable_dbus_transformation;
Report.set_verbose_errors (!quiet_mode);
var t = param.parameter_type.data_type;
if (t != null && t.is_reference_type ()) {
if (param.direction != ParameterDirection.OUT) {
- var type_check = create_method_type_check_statement (m, creturn_type, t, (context.non_null && !param.parameter_type.nullable), param.name);
+ var type_check = create_method_type_check_statement (m, creturn_type, t, !param.parameter_type.nullable, param.name);
if (type_check != null) {
type_check.line = function.line;
cinit.append (type_check);
*/
public bool checking { get; set; }
- /**
- * Enable non-null types.
- */
- public bool non_null { get; set; }
-
/**
* Enable experimental enhancements for non-null types.
*/
}
}
- if (analyzer.context.non_null && default_expression != null) {
+ if (default_expression != null) {
if (default_expression is NullLiteral
&& !parameter_type.nullable
&& direction != ParameterDirection.OUT) {
/* valareturnstatement.vala
*
- * Copyright (C) 2006-2008 Jürg Billeter
+ * Copyright (C) 2006-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Report.warning (source_reference, "Local variable with strong reference used as return value and method return type hasn't been declared to transfer ownership");
}
- if (analyzer.context.non_null && return_expression is NullLiteral
+ if (return_expression is NullLiteral
&& !analyzer.current_return_type.nullable) {
Report.warning (source_reference, "`null' incompatible with return type `%s`".printf (analyzer.current_return_type.to_string ()));
}
if (direction == ParameterDirection.REF) {
Report.error (arg.source_reference, "Argument %d: Cannot pass null to reference parameter".printf (i + 1));
return false;
- } else if (context.non_null && direction != ParameterDirection.OUT && !arg.target_type.nullable) {
+ } else if (direction != ParameterDirection.OUT && !arg.target_type.nullable) {
Report.warning (arg.source_reference, "Argument %d: Cannot pass null to non-null parameter type".printf (i + 1));
}
} else if (arg_type == 1) {