[vala/staging] 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/staging] vala: Perform version check for types of non-external variable declarations
- Date: Thu, 16 Apr 2020 10:40:20 +0000 (UTC)
commit 2a7a1e3589146366186e5db72f075cb769e21af0
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 | 5 +++++
vala/valalocalvariable.vala | 7 +++++++
vala/valaparameter.vala | 5 +++++
3 files changed, 17 insertions(+)
---
diff --git a/vala/valafield.vala b/vala/valafield.vala
index c7201d02e..3b6eeda75 100644
--- a/vala/valafield.vala
+++ b/vala/valafield.vala
@@ -107,6 +107,11 @@ public class Vala.Field : Variable, Lockable {
variable_type.check (context);
if (!external_package) {
context.analyzer.check_type (variable_type);
+
+ // check symbol availability
+ if (variable_type.type_symbol != null) {
+ variable_type.type_symbol.version.check (source_reference);
+ }
}
// check whether field type is at least as accessible as the field
diff --git a/vala/valalocalvariable.vala b/vala/valalocalvariable.vala
index 64e16325b..dbe9ace11 100644
--- a/vala/valalocalvariable.vala
+++ b/vala/valalocalvariable.vala
@@ -160,6 +160,13 @@ public class Vala.LocalVariable : Variable {
variable_type.check (context);
}
+ if (!external_package) {
+ // check symbol availability
+ if (variable_type.type_symbol != null) {
+ variable_type.type_symbol.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 f99f484da..f0e817b48 100644
--- a/vala/valaparameter.vala
+++ b/vala/valaparameter.vala
@@ -199,6 +199,11 @@ public class Vala.Parameter : Variable {
if (!ellipsis) {
if (!external_package) {
context.analyzer.check_type (variable_type);
+
+ // check symbol availability
+ if (!parent_symbol.external_package && variable_type.type_symbol != null) {
+ variable_type.type_symbol.version.check (source_reference);
+ }
}
// check whether parameter type is at least as accessible as the method
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]