From: Rico Tzschichholz Date: Sat, 6 Nov 2021 17:55:37 +0000 (+0100) Subject: vala: Drop SemanticAnalyzer.is_type_accessible() X-Git-Tag: 0.55.1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f28a5dbd75d5ae5c5883a77468f800b86cd1855;p=thirdparty%2Fvala.git vala: Drop SemanticAnalyzer.is_type_accessible() --- diff --git a/vala/valaclass.vala b/vala/valaclass.vala index a6f5ae633..436a6b3cf 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -553,7 +553,7 @@ public class Vala.Class : ObjectTypeSymbol { } // check whether base type is at least as accessible as the class - if (!context.analyzer.is_type_accessible (this, base_type_reference)) { + if (!base_type_reference.is_accessible (this)) { error = true; Report.error (source_reference, "base type `%s' is less accessible than class `%s'", base_type_reference.to_string (), get_full_name ()); return false; diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala index 5b30e7f38..92591026c 100644 --- a/vala/valaconstant.vala +++ b/vala/valaconstant.vala @@ -122,7 +122,7 @@ public class Vala.Constant : Symbol { } // check whether constant type is at least as accessible as the constant - if (!context.analyzer.is_type_accessible (this, type_reference)) { + if (!type_reference.is_accessible (this)) { error = true; Report.error (source_reference, "constant type `%s' is less accessible than constant `%s'", type_reference.to_string (), get_full_name ()); } diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index 77b311f31..45adef65f 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -147,7 +147,7 @@ public class Vala.CreationMethod : Method { error_type.check (context); // check whether error type is at least as accessible as the creation method - if (!context.analyzer.is_type_accessible (this, error_type)) { + if (!error_type.is_accessible (this)) { error = true; Report.error (source_reference, "error type `%s' is less accessible than creation method `%s'", error_type.to_string (), get_full_name ()); return false; diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala index 249adcdfc..eeaabcb69 100644 --- a/vala/valadelegate.vala +++ b/vala/valadelegate.vala @@ -341,7 +341,7 @@ public class Vala.Delegate : TypeSymbol, Callable { error_type.check (context); // check whether error type is at least as accessible as the delegate - if (!context.analyzer.is_type_accessible (this, error_type)) { + if (!error_type.is_accessible (this)) { error = true; Report.error (source_reference, "error type `%s' is less accessible than delegate `%s'", error_type.to_string (), get_full_name ()); return false; diff --git a/vala/valafield.vala b/vala/valafield.vala index 731249e71..566a68b12 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -120,7 +120,7 @@ public class Vala.Field : Variable, Lockable { } // check whether field type is at least as accessible as the field - if (!context.analyzer.is_type_accessible (this, variable_type)) { + if (!variable_type.is_accessible (this)) { error = true; Report.error (source_reference, "field type `%s' is less accessible than field `%s'", variable_type.to_string (), get_full_name ()); return false; diff --git a/vala/valainterface.vala b/vala/valainterface.vala index d3d8733d0..92e5da154 100644 --- a/vala/valainterface.vala +++ b/vala/valainterface.vala @@ -172,7 +172,7 @@ public class Vala.Interface : ObjectTypeSymbol { foreach (DataType prerequisite_reference in get_prerequisites ()) { // check whether prerequisite is at least as accessible as the interface - if (!context.analyzer.is_type_accessible (this, prerequisite_reference)) { + if (!prerequisite_reference.is_accessible (this)) { error = true; Report.error (source_reference, "prerequisite `%s' is less accessible than interface `%s'", prerequisite_reference.to_string (), get_full_name ()); return false; diff --git a/vala/valamethod.vala b/vala/valamethod.vala index dc41e3d77..f3617c4bd 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -931,7 +931,7 @@ public class Vala.Method : Subroutine, Callable { error_type.check (context); // check whether error type is at least as accessible as the method - if (!context.analyzer.is_type_accessible (this, error_type)) { + if (!error_type.is_accessible (this)) { error = true; Report.error (source_reference, "error type `%s' is less accessible than method `%s'", error_type.to_string (), get_full_name ()); return false; @@ -998,7 +998,7 @@ public class Vala.Method : Subroutine, Callable { } // check whether return type is at least as accessible as the method - if (!context.analyzer.is_type_accessible (this, return_type)) { + if (!return_type.is_accessible (this)) { error = true; Report.error (source_reference, "return type `%s' is less accessible than method `%s'", return_type.to_string (), get_full_name ()); return false; diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index 7bbb2cedb..656188848 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -216,7 +216,7 @@ public class Vala.Parameter : Variable { } // check whether parameter type is at least as accessible as the method - if (!context.analyzer.is_type_accessible (this, variable_type)) { + if (!variable_type.is_accessible (this)) { error = true; Report.error (source_reference, "parameter type `%s' is less accessible than method `%s'", variable_type.to_string (), parent_symbol.get_full_name ()); } diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index 6f04ff97d..fac24d53d 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -520,7 +520,7 @@ public class Vala.Property : Symbol, Lockable { } // check whether property type is at least as accessible as the property - if (!context.analyzer.is_type_accessible (this, property_type)) { + if (!property_type.is_accessible (this)) { error = true; Report.error (source_reference, "property type `%s' is less accessible than property `%s'", property_type.to_string (), get_full_name ()); } diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 7f2e56c03..b49a8299d 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -263,11 +263,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor { file.check (context); } - // check whether type is at least as accessible as the specified symbol - public bool is_type_accessible (Symbol sym, DataType type) { - return type.is_accessible (sym); - } - public DataType? get_value_type_for_symbol (Symbol sym, bool lvalue) { if (sym is Field) { unowned Field f = (Field) sym; diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 2ac7034af..5cce4b24b 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -512,7 +512,7 @@ public class Vala.Struct : TypeSymbol { } // check whether base type is at least as accessible as the struct - if (!context.analyzer.is_type_accessible (this, base_type)) { + if (!base_type.is_accessible (this)) { error = true; Report.error (source_reference, "base type `%s' is less accessible than struct `%s'", base_type.to_string (), get_full_name ()); }