[vala/1270-remove-static-codecontext-access: 26/44] Assigment: use context if available to avoid Report static access
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/1270-remove-static-codecontext-access: 26/44] Assigment: use context if available to avoid Report static access
- Date: Mon, 3 Jan 2022 23:53:28 +0000 (UTC)
commit 12509e37fcca0cd5b65dcd55c0137c989d1e04c6
Author: Daniel Espinosa <esodan gmail com>
Date: Sun Jan 2 17:11:37 2022 -0600
Assigment: use context if available to avoid Report static access
vala/valaassignment.vala | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala
index 672303256..936b8cec5 100644
--- a/vala/valaassignment.vala
+++ b/vala/valaassignment.vala
@@ -306,7 +306,7 @@ public class Vala.Assignment : Expression {
unowned ArrayType? variable_array_type = variable.variable_type as ArrayType;
if (variable_array_type != null && variable_array_type.inline_allocated
&& right is ArrayCreationExpression && ((ArrayCreationExpression)
right).initializer_list == null) {
- Report.warning (source_reference, "Inline allocated arrays don't
require an explicit instantiation");
+ context.report.log_warning (source_reference, "Inline allocated
arrays don't require an explicit instantiation");
((Block) parent_node.parent_node).replace_statement ((Statement)
parent_node, new EmptyStatement (source_reference));
return true;
}
@@ -323,7 +323,7 @@ public class Vala.Assignment : Expression {
} else if (left.value_type is EnumValueType && right.value_type is IntegerType
&& (!(right is IntegerLiteral) || ((IntegerLiteral) right).value != "0"))
{
//FIXME This will have to be an error in the future?
- Report.notice (source_reference, "Assignment: Unsafe conversion from
`%s' to `%s'", right.value_type.to_string (), left.value_type.to_string ());
+ context.report.log_notice (source_reference, "Assignment: Unsafe
conversion from `%s' to `%s'", right.value_type.to_string (), left.value_type.to_string ());
}
if (!(ma.symbol_reference is Property)) {
@@ -346,17 +346,17 @@ public class Vala.Assignment : Expression {
unowned MemberAccess? right_ma = right as MemberAccess;
if (right_ma != null && ma.symbol_reference == right_ma.symbol_reference) {
if (ma.symbol_reference is LocalVariable || ma.symbol_reference is Parameter)
{
- Report.warning (source_reference, "Assignment to same variable");
+ context.report.log_warning (source_reference, "Assignment to same
variable");
} else if (ma.symbol_reference is Field) {
unowned Field f = (Field) ma.symbol_reference;
if (f.binding == MemberBinding.STATIC) {
- Report.warning (source_reference, "Assignment to same
variable");
+ context.report.log_warning (source_reference, "Assignment to
same variable");
} else {
unowned MemberAccess? ma_inner = ma.inner as MemberAccess;
unowned MemberAccess? right_ma_inner = right_ma.inner as
MemberAccess;
if (ma_inner != null && ma_inner.member_name == "this" &&
ma_inner.inner == null &&
right_ma_inner != null && right_ma_inner.member_name ==
"this" && right_ma_inner.inner == null) {
- Report.warning (source_reference, "Assignment to same
variable");
+ context.report.log_warning (source_reference,
"Assignment to same variable");
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]