]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when accessing constants of outer methods d72b93c136b6fcc1dfa2cba10e45e676edfe0cc9
authorJürg Billeter <j@bitron.ch>
Sun, 24 Jun 2012 15:02:01 +0000 (17:02 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 24 Jun 2012 15:02:28 +0000 (17:02 +0200)
This is planned to be supported.

https://bugzilla.gnome.org/show_bug.cgi?id=678617

vala/valamemberaccess.vala

index 3958777f338d9c5cbda78df87ddc9a1f3ea62913..358693eba3e063946560766b1d5401fb733b6c5f 100644 (file)
@@ -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) {