From: Rico Tzschichholz Date: Tue, 12 Mar 2019 09:06:11 +0000 (+0100) Subject: Mark defined constructors of abstract classes as protected X-Git-Tag: 0.36.19~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4ce99bb1a7627572f4814d855e55f1a167991d0;p=thirdparty%2Fvala.git Mark defined constructors of abstract classes as protected --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 617849f59..1d0b416ae 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -352,7 +352,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public static int ccode_attribute_cache_index = CodeNode.get_attribute_cache_index (); - public CCodeBaseModule () { + protected CCodeBaseModule () { predefined_marshal_set = new HashSet (str_hash, str_equal); predefined_marshal_set.add ("VOID:VOID"); predefined_marshal_set.add ("VOID:BOOLEAN"); diff --git a/tests/asynchronous/generator.vala b/tests/asynchronous/generator.vala index f31e12a42..2c3654b56 100644 --- a/tests/asynchronous/generator.vala +++ b/tests/asynchronous/generator.vala @@ -7,7 +7,7 @@ abstract class Generator { unowned G value; SourceFunc callback; - public Generator () { + protected Generator () { helper.begin (); } diff --git a/tests/chainup/bug791785.vala b/tests/chainup/bug791785.vala index eb46b0141..608de6b0e 100644 --- a/tests/chainup/bug791785.vala +++ b/tests/chainup/bug791785.vala @@ -5,7 +5,7 @@ struct Foo { abstract class AbstractBar { public Foo foo; - public AbstractBar (Foo foo) { + protected AbstractBar (Foo foo) { this.foo = foo; } } diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala index 14fc230da..f254065c8 100644 --- a/vala/valaobjecttypesymbol.vala +++ b/vala/valaobjecttypesymbol.vala @@ -31,7 +31,7 @@ public abstract class Vala.ObjectTypeSymbol : TypeSymbol { private List type_parameters = new ArrayList (); - public ObjectTypeSymbol (string name, SourceReference? source_reference = null, Comment? comment = null) { + protected ObjectTypeSymbol (string name, SourceReference? source_reference = null, Comment? comment = null) { base (name, source_reference, comment); } diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala index c9f7d1e93..02755db76 100644 --- a/vala/valasymbol.vala +++ b/vala/valasymbol.vala @@ -192,7 +192,7 @@ public abstract class Vala.Symbol : CodeNode { private weak Scope _owner; private Scope _scope; - public Symbol (string? name, SourceReference? source_reference, Comment? comment = null) { + protected Symbol (string? name, SourceReference? source_reference, Comment? comment = null) { this.name = name; this.source_reference = source_reference; this.comment = comment; diff --git a/vala/valatypesymbol.vala b/vala/valatypesymbol.vala index 8ba3aef57..f84b53f5f 100644 --- a/vala/valatypesymbol.vala +++ b/vala/valatypesymbol.vala @@ -29,7 +29,7 @@ using GLib; * code or imported from an external library with a Vala API file. */ public abstract class Vala.TypeSymbol : Symbol { - public TypeSymbol (string? name, SourceReference? source_reference = null, Comment? comment = null) { + protected TypeSymbol (string? name, SourceReference? source_reference = null, Comment? comment = null) { base (name, source_reference, comment); } diff --git a/vala/valavaluetype.vala b/vala/valavaluetype.vala index d78af9960..ed1225d6d 100644 --- a/vala/valavaluetype.vala +++ b/vala/valavaluetype.vala @@ -31,7 +31,7 @@ public abstract class Vala.ValueType : DataType { */ public weak TypeSymbol type_symbol { get; set; } - public ValueType (TypeSymbol type_symbol) { + protected ValueType (TypeSymbol type_symbol) { this.type_symbol = type_symbol; data_type = type_symbol; }