[vala/0.40] vala: Perform version check for types of non-external variable declarations
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] vala: Perform version check for types of non-external variable declarations
- Date: Tue, 21 Apr 2020 07:50:50 +0000 (UTC)
commit 9b2b55650737174f137d119a7dc7022666a083e7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Apr 16 12:37:26 2020 +0200
vala: Perform version check for types of non-external variable declarations
vala/valafield.vala | 6 ++++++
vala/valalocalvariable.vala | 7 +++++++
vala/valaparameter.vala | 7 +++++++
3 files changed, 20 insertions(+)
---
diff --git a/vala/valafield.vala b/vala/valafield.vala
index 163fb011c..92f28c679 100644
--- a/vala/valafield.vala
+++ b/vala/valafield.vala
@@ -113,6 +113,12 @@ public class Vala.Field : Variable, Lockable {
}
variable_type.check (context);
+ if (!external_package) {
+ // check symbol availability
+ if (variable_type.data_type != null) {
+ variable_type.data_type.version.check (source_reference);
+ }
+ }
// check whether field type is at least as accessible as the field
if (!context.analyzer.is_type_accessible (this, variable_type)) {
diff --git a/vala/valalocalvariable.vala b/vala/valalocalvariable.vala
index 4bf103757..ad0231f84 100644
--- a/vala/valalocalvariable.vala
+++ b/vala/valalocalvariable.vala
@@ -139,6 +139,13 @@ public class Vala.LocalVariable : Variable {
variable_type.check (context);
}
+ if (!external_package) {
+ // check symbol availability
+ if (variable_type.data_type != null) {
+ variable_type.data_type.version.check (source_reference);
+ }
+ }
+
unowned ArrayType? variable_array_type = variable_type as ArrayType;
if (variable_array_type != null && variable_array_type.inline_allocated
&& initializer is ArrayCreationExpression && ((ArrayCreationExpression)
initializer).initializer_list == null) {
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala
index 70bf20528..d12bd9c2f 100644
--- a/vala/valaparameter.vala
+++ b/vala/valaparameter.vala
@@ -197,6 +197,13 @@ public class Vala.Parameter : Variable {
}
if (!ellipsis) {
+ if (!external_package) {
+ // check symbol availability
+ if ((parent_symbol == null || !parent_symbol.external_package) &&
variable_type.data_type != null) {
+ variable_type.data_type.version.check (source_reference);
+ }
+ }
+
// check whether parameter type is at least as accessible as the method
if (!context.analyzer.is_type_accessible (this, variable_type)) {
error = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]