vala r1226 - in trunk: . ccode gee vala vapi vapigen
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1226 - in trunk: . ccode gee vala vapi vapigen
- Date: Mon, 14 Apr 2008 19:16:49 +0100 (BST)
Author: juergbi
Date: Mon Apr 14 19:16:48 2008
New Revision: 1226
URL: http://svn.gnome.org/viewvc/vala?rev=1226&view=rev
Log:
2008-04-14 Juerg Billeter <j bitron ch>
* vala/valasemanticanalyzer.vala: report error when using null
literal as default expression of non-null parameter,
fixes bug 528021
* gee/readonlycollection.vala, gee/readonlylist.vala,
gee/readonlymap.vala, gee/readonlyset.vala, vala/valascope.vala,
ccode/valaccodeforstatement.vala, ccode/valaccodewhilestatement.vala,
vapigen/valavapicheck.vala, vapi/glib-2.0.vapi: fix revealed bugs
Modified:
trunk/ChangeLog
trunk/ccode/valaccodeforstatement.vala
trunk/ccode/valaccodewhilestatement.vala
trunk/gee/readonlycollection.vala
trunk/gee/readonlylist.vala
trunk/gee/readonlymap.vala
trunk/gee/readonlyset.vala
trunk/vala/valascope.vala
trunk/vala/valasemanticanalyzer.vala
trunk/vapi/glib-2.0.vapi
trunk/vapigen/valavapicheck.vala
Modified: trunk/ccode/valaccodeforstatement.vala
==============================================================================
--- trunk/ccode/valaccodeforstatement.vala (original)
+++ trunk/ccode/valaccodeforstatement.vala Mon Apr 14 19:16:48 2008
@@ -1,6 +1,6 @@
/* valaccodeforstatement.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter
+ * Copyright (C) 2006-2008 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
@@ -40,7 +40,7 @@
private Gee.List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
private Gee.List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
- public CCodeForStatement (CCodeExpression condition, CCodeStatement body = null) {
+ public CCodeForStatement (CCodeExpression condition, CCodeStatement? body = null) {
this.body = body;
this.condition = condition;
}
Modified: trunk/ccode/valaccodewhilestatement.vala
==============================================================================
--- trunk/ccode/valaccodewhilestatement.vala (original)
+++ trunk/ccode/valaccodewhilestatement.vala Mon Apr 14 19:16:48 2008
@@ -1,6 +1,6 @@
/* valaccodewhilestatement.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter
+ * Copyright (C) 2006-2008 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
@@ -36,7 +36,7 @@
*/
public CCodeStatement body { get; set; }
- public CCodeWhileStatement (CCodeExpression cond, CCodeStatement stmt = null) {
+ public CCodeWhileStatement (CCodeExpression cond, CCodeStatement? stmt = null) {
condition = cond;
body = stmt;
}
Modified: trunk/gee/readonlycollection.vala
==============================================================================
--- trunk/gee/readonlycollection.vala (original)
+++ trunk/gee/readonlycollection.vala Mon Apr 14 19:16:48 2008
@@ -36,7 +36,7 @@
private Collection<G> _collection;
- public ReadOnlyCollection (Collection<G> collection = null) {
+ public ReadOnlyCollection (Collection<G>? collection = null) {
this.collection = collection;
}
Modified: trunk/gee/readonlylist.vala
==============================================================================
--- trunk/gee/readonlylist.vala (original)
+++ trunk/gee/readonlylist.vala Mon Apr 14 19:16:48 2008
@@ -36,7 +36,7 @@
private List<G> _list;
- public ReadOnlyList (List<G> list = null) {
+ public ReadOnlyList (List<G>? list = null) {
this.list = list;
}
Modified: trunk/gee/readonlymap.vala
==============================================================================
--- trunk/gee/readonlymap.vala (original)
+++ trunk/gee/readonlymap.vala Mon Apr 14 19:16:48 2008
@@ -36,7 +36,7 @@
private Map<K,V> _map;
- public ReadOnlyMap (Map<K,V> map = null) {
+ public ReadOnlyMap (Map<K,V>? map = null) {
this.map = map;
}
Modified: trunk/gee/readonlyset.vala
==============================================================================
--- trunk/gee/readonlyset.vala (original)
+++ trunk/gee/readonlyset.vala Mon Apr 14 19:16:48 2008
@@ -36,7 +36,7 @@
private Set<G> _set;
- public ReadOnlySet (Set<G> set = null) {
+ public ReadOnlySet (Set<G>? set = null) {
this.set = set;
}
Modified: trunk/vala/valascope.vala
==============================================================================
--- trunk/vala/valascope.vala (original)
+++ trunk/vala/valascope.vala Mon Apr 14 19:16:48 2008
@@ -44,7 +44,7 @@
*
* @return newly created scope
*/
- public Scope (Symbol owner = null) {
+ public Scope (Symbol? owner = null) {
this.owner = owner;
}
Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala (original)
+++ trunk/vala/valasemanticanalyzer.vala Mon Apr 14 19:16:48 2008
@@ -533,6 +533,16 @@
public override void visit_formal_parameter (FormalParameter p) {
p.accept_children (this);
+ if (p.default_expression != null) {
+ if (p.default_expression is NullLiteral
+ && !p.type_reference.nullable
+ && !p.type_reference.is_out) {
+ p.error = true;
+ Report.error (p.source_reference, "`null' incompatible with parameter type `%s`".printf (p.type_reference.to_string ()));
+ return;
+ }
+ }
+
if (!p.ellipsis) {
if (!p.is_internal_symbol ()) {
current_source_file.add_type_dependency (p.type_reference, SourceFileDependencyType.HEADER_SHALLOW);
Modified: trunk/vapi/glib-2.0.vapi
==============================================================================
--- trunk/vapi/glib-2.0.vapi (original)
+++ trunk/vapi/glib-2.0.vapi Mon Apr 14 19:16:48 2008
@@ -1209,7 +1209,7 @@
}
public class Thread {
- public static void init (ThreadFunctions vtable = null);
+ public static void init (ThreadFunctions? vtable = null);
public static bool supported ();
public static weak Thread create (ThreadFunc func, bool joinable) throws ThreadError;
public static weak Thread create_full (ThreadFunc func, ulong stack_size, bool joinable, bool bound, ThreadPriority priority) throws ThreadError;
@@ -1502,7 +1502,7 @@
public static string to_utf8 (string opsysstring, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
public static string from_utf8 (string utf8string, long len, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
public static string from_uri (string uri, out string hostname = null) throws ConvertError;
- public static string to_uri (string filename, string hostname = null) throws ConvertError;
+ public static string to_uri (string filename, string? hostname = null) throws ConvertError;
public static string display_name (string filename);
public static string display_basename (string filename);
}
Modified: trunk/vapigen/valavapicheck.vala
==============================================================================
--- trunk/vapigen/valavapicheck.vala (original)
+++ trunk/vapigen/valavapicheck.vala Mon Apr 14 19:16:48 2008
@@ -49,7 +49,7 @@
}
}
- private void add_symbol (string name, string separator = null) {
+ private void add_symbol (string name, string? separator = null) {
if (null != separator) {
string fullname = get_scope () + separator + name;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]