[vala/0.36] Revert "Do not warn about non-default parameters for coroutines."
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36] Revert "Do not warn about non-default parameters for coroutines."
- Date: Fri, 19 Jan 2018 08:39:22 +0000 (UTC)
commit a04af20576df8b50eae13290ab31fd82975d908e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Jan 18 20:38:47 2018 +0100
Revert "Do not warn about non-default parameters for coroutines."
Breaks parameter inference for async method overrides.
This reverts commit dd24a1bfe1a78bf1a37d35f5d8dd6480fd4a8941.
https://bugzilla.gnome.org/show_bug.cgi?id=792660
vala/valamethod.vala | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 1778e77..85f9d46 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -723,20 +723,17 @@ public class Vala.Method : Subroutine, Callable {
Report.error (parameters[0].source_reference, "Named parameter required before
`...'");
}
- if (!coroutine) {
- // TODO: begin and end parameters must be checked separately for coroutines
- var optional_param = false;
- foreach (Parameter param in parameters) {
- param.check (context);
- if (coroutine && param.direction == ParameterDirection.REF) {
- error = true;
- Report.error (param.source_reference, "Reference parameters are not
supported for async methods");
- }
- if (optional_param && param.initializer == null && !param.ellipsis) {
- Report.warning (param.source_reference, "parameter without default
follows parameter with default");
- } else if (param.initializer != null) {
- optional_param = true;
- }
+ var optional_param = false;
+ foreach (Parameter param in parameters) {
+ param.check (context);
+ if (coroutine && param.direction == ParameterDirection.REF) {
+ error = true;
+ Report.error (param.source_reference, "Reference parameters are not supported
for async methods");
+ }
+ if (optional_param && param.initializer == null && !param.ellipsis) {
+ Report.warning (param.source_reference, "parameter without default follows
parameter with default");
+ } else if (param.initializer != null) {
+ optional_param = true;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]