[vala/wip/issue/901: 2/4] vala: Fix base-access check for compact classes



commit d839ffe77b00df60ee7c8d8108433c95f0b27b47
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 9a7d7ceb6..002514504 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]