]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Drop SemanticAnalyzer.is_type_accessible()
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 6 Nov 2021 17:55:37 +0000 (18:55 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 6 Nov 2021 18:34:28 +0000 (19:34 +0100)
vala/valaclass.vala
vala/valaconstant.vala
vala/valacreationmethod.vala
vala/valadelegate.vala
vala/valafield.vala
vala/valainterface.vala
vala/valamethod.vala
vala/valaparameter.vala
vala/valaproperty.vala
vala/valasemanticanalyzer.vala
vala/valastruct.vala

index a6f5ae6339679a4faf8551fc7919da7412e5de89..436a6b3cfe3f9d6c9b33ff9e84f38957c980477e 100644 (file)
@@ -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;
index 5b30e7f38374223f5d4479e711fad3d0e5af47dc..92591026c5872fef2c64e011472ba067fa9e4102 100644 (file)
@@ -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 ());
                }
index 77b311f3163a063fe4c842a65ca340be9c6ea64c..45adef65fbcf71815b030510c3d22f64c9235aa0 100644 (file)
@@ -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;
index 249adcdfc35eaf63ece3af9323134f8d3a78fc22..eeaabcb69445fbdc535dc59994e687154b447a27 100644 (file)
@@ -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;
index 731249e71e0413b25e2e6ac7dda74dbcb6ea667d..566a68b12400a3da96771ce5853be26f9d1fd600 100644 (file)
@@ -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;
index d3d8733d04a0ef17cb451ff4a40ed50f63e97c3e..92e5da1544528e52c3f5c96f5078b45af6e8f580 100644 (file)
@@ -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;
index dc41e3d77eac01edd5efcf2f59150845717e39fc..f3617c4bd129dbd9be3af6e3059d7db07770db47 100644 (file)
@@ -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;
index 7bbb2cedbd787c367da0b56015c9cdc63300b3d0..656188848dd4dff6121692dce57682de1990e8b5 100644 (file)
@@ -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 ());
                        }
index 6f04ff97db2503d1ec7f45ee524822fce9f3cc4c..fac24d53d1e9ee3556609ad7171cad986c9a7b5b 100644 (file)
@@ -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 ());
                }
index 7f2e56c0394032b545cc2252368616c0e9a6c3a2..b49a8299d437674d56458598e9988ceedfb75fed 100644 (file)
@@ -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;
index 2ac7034af41835080dbb0b754cb7fd0972da9b03..5cce4b24b57a05ae6e0096bec9ae8881620d7908 100644 (file)
@@ -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 ());
                        }