[vala/0.46] vala: Fix base-access check for compact classes (2)



commit 66a0801b58da48cd86f63b82db994b7619405b64
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Feb 4 16:58:52 2020 +0100

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

 vala/valabaseaccess.vala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/vala/valabaseaccess.vala b/vala/valabaseaccess.vala
index d15953ba0..ed8193507 100644
--- a/vala/valabaseaccess.vala
+++ b/vala/valabaseaccess.vala
@@ -78,12 +78,13 @@ 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.overrides) {
+                   && !(context.analyzer.current_method is CreationMethod)
+                   && (context.analyzer.current_method.overrides || 
context.analyzer.current_method.is_virtual)) {
                        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
-                   && context.analyzer.current_property_accessor.get_method ().overrides) {
+                   && (context.analyzer.current_property_accessor.prop.overrides || 
context.analyzer.current_property_accessor.prop.is_virtual)) {
                        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]