From: Juerg Billeter Date: Mon, 14 Apr 2008 17:48:59 +0000 (+0000) Subject: report warning when using weak type modifier in cast expressions, fixes X-Git-Tag: VALA_0_3_1~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5dd97eacbecfa963a2ccc0edb11d6fa7c855c7a;p=platform%2Fupstream%2Fvala.git report warning when using weak type modifier in cast expressions, fixes 2008-04-14 Juerg Billeter * vala/valaparser.vala: report warning when using weak type modifier in cast expressions, fixes bug 527990 svn path=/trunk/; revision=1224 --- diff --git a/ChangeLog b/ChangeLog index b0f40e5..cd97ee7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-14 Jürg Billeter + * vala/valaparser.vala: report warning when using weak type + modifier in cast expressions, fixes bug 527990 + +2008-04-14 Jürg Billeter + * vala/valasemanticanalyzer.vala: fix interface base access, fixes bug 527985 diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 42880a8..f532bb4 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -728,6 +728,7 @@ public class Vala.Parser : CodeVisitor { next (); switch (current ()) { case TokenType.VOID: + case TokenType.WEAK: case TokenType.IDENTIFIER: var type = parse_type (); if (accept (TokenType.CLOSE_PARENS)) { @@ -749,6 +750,10 @@ public class Vala.Parser : CodeVisitor { case TokenType.SIZEOF: case TokenType.TYPEOF: case TokenType.IDENTIFIER: + var ut = type as UnresolvedType; + if (ut != null && ut.is_weak) { + Report.warning (get_src (begin), "obsolete syntax, weak type modifier unused in cast expressions"); + } var inner = parse_unary_expression (); return context.create_cast_expression (inner, type, get_src (begin), false); }