[vala/0.40] vala: Fix base-access check for compact classes



commit 17c943e03fd496009159f0eea7a1f012de8ef128
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Jan 25 18:33:13 2020 +0100

    vala: Fix base-access check for compact classes
    
    See 84de99560ee96afa8cb80db3b342d584a72188cd

 vala/valabaseaccess.vala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/vala/valabaseaccess.vala b/vala/valabaseaccess.vala
index 918997c14..7dd42a011 100644
--- a/vala/valabaseaccess.vala
+++ b/vala/valabaseaccess.vala
@@ -78,11 +78,12 @@ public class Vala.BaseAccess : Expression {
                        Report.error (source_reference, "Base access invalid without base class");
                        return false;
                } else if (context.analyzer.current_class.is_compact && context.analyzer.current_method != 
null
-                   && !(context.analyzer.current_method is CreationMethod)) {
+                   && !(context.analyzer.current_method is CreationMethod) && 
context.analyzer.current_method.overrides) {
                        error = true;
                        Report.error (source_reference, "Base access invalid in virtual overridden method of 
compact class");
                        return false;
-               } else if (context.analyzer.current_class.is_compact && 
context.analyzer.current_property_accessor != null) {
+               } else if (context.analyzer.current_class.is_compact && 
context.analyzer.current_property_accessor != null
+                   && context.analyzer.current_property_accessor.get_method ().overrides) {
                        error = true;
                        Report.error (source_reference, "Base access invalid in virtual overridden property 
of compact class");
                        return false;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]