From: Jürg Billeter Date: Sat, 10 Jan 2009 12:37:46 +0000 (+0000) Subject: Remove --disable-non-null option after transition period of 9 months X-Git-Tag: VALA_0_5_5~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3046d0e0ae5aebf1cb68d39e5cd7edbc70d1c1ff;p=thirdparty%2Fvala.git Remove --disable-non-null option after transition period of 9 months 2009-01-10 Jürg Billeter * 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 svn path=/trunk/; revision=2320 --- diff --git a/ChangeLog b/ChangeLog index 534eb1c8a..d0424d826 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-01-10 Jürg Billeter + + * 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 * vala/valaclass.vala: diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index f8ee7e193..74b37c8da 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -46,7 +46,6 @@ class Vala.Compiler { 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; @@ -73,7 +72,6 @@ class Vala.Compiler { { "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" }, @@ -156,7 +154,6 @@ class Vala.Compiler { 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); diff --git a/gobject/valaccodemethodmodule.vala b/gobject/valaccodemethodmodule.vala index 822b976d9..de786de27 100644 --- a/gobject/valaccodemethodmodule.vala +++ b/gobject/valaccodemethodmodule.vala @@ -288,7 +288,7 @@ public class Vala.CCodeMethodModule : CCodeStructModule { 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); diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index a30443268..af76c267d 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -50,11 +50,6 @@ public class Vala.CodeContext { */ public bool checking { get; set; } - /** - * Enable non-null types. - */ - public bool non_null { get; set; } - /** * Enable experimental enhancements for non-null types. */ diff --git a/vala/valaformalparameter.vala b/vala/valaformalparameter.vala index b22e5d219..d848d1725 100644 --- a/vala/valaformalparameter.vala +++ b/vala/valaformalparameter.vala @@ -215,7 +215,7 @@ public class Vala.FormalParameter : Symbol { } } - if (analyzer.context.non_null && default_expression != null) { + if (default_expression != null) { if (default_expression is NullLiteral && !parameter_type.nullable && direction != ParameterDirection.OUT) { diff --git a/vala/valareturnstatement.vala b/vala/valareturnstatement.vala index c9c99ea8a..2f6a2bd88 100644 --- a/vala/valareturnstatement.vala +++ b/vala/valareturnstatement.vala @@ -1,6 +1,6 @@ /* 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 @@ -132,7 +132,7 @@ public class Vala.ReturnStatement : CodeNode, Statement { 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 ())); } diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index bd1d25a0f..329275b3a 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -415,7 +415,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { 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) {