[vala/0.40] parser: Implicit creation method of abstract classes must be protected



commit 1a73522c6b5a84ae29c8addbfbdd28eac0299bc9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Mar 12 10:18:03 2019 +0100

    parser: Implicit creation method of abstract classes must be protected

 vala/valagenieparser.vala | 2 +-
 vala/valaparser.vala      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 1f1df4f59..e69fae23c 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -2702,7 +2702,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                if (scanner.source_file.file_type == SourceFileType.SOURCE
                        && cl.default_construction_method == null) {
                        var m = new CreationMethod (cl.name, null, cl.source_reference);
-                       m.access = SymbolAccessibility.PUBLIC;
+                       m.access = (cl.is_abstract ? SymbolAccessibility.PROTECTED : 
SymbolAccessibility.PUBLIC);
                        m.body = new Block (cl.source_reference);
                        cl.add_method (m);
                }
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 86423bc80..fccb6662d 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -2564,7 +2564,7 @@ public class Vala.Parser : CodeVisitor {
                if (scanner.source_file.file_type == SourceFileType.SOURCE
                    && cl.default_construction_method == null) {
                        var m = new CreationMethod (cl.name, null, cl.source_reference);
-                       m.access = SymbolAccessibility.PUBLIC;
+                       m.access = (cl.is_abstract ? SymbolAccessibility.PROTECTED : 
SymbolAccessibility.PUBLIC);
                        m.body = new Block (cl.source_reference);
                        cl.add_method (m);
                }


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