From: Jürg Billeter Date: Sun, 24 Jun 2012 15:02:01 +0000 (+0200) Subject: Report error when accessing constants of outer methods X-Git-Tag: 0.17.3~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fkeep-around%2Fd72b93c136b6fcc1dfa2cba10e45e676edfe0cc9;p=thirdparty%2Fvala.git Report error when accessing constants of outer methods This is planned to be supported. https://bugzilla.gnome.org/show_bug.cgi?id=678617 --- diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index 3958777f3..358693eba 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -532,6 +532,13 @@ public class Vala.MemberAccess : Expression { } else if (member is Constant) { var c = (Constant) member; access = c.access; + + var block = c.parent_symbol as Block; + if (block != null && context.analyzer.find_parent_method_or_property_accessor (block) != context.analyzer.current_method_or_property_accessor) { + error = true; + Report.error (source_reference, "internal error: accessing local constants of outer methods is not supported yet"); + return false; + } } else if (member is Method) { var m = (Method) member; if (m.is_async_callback) {