[vala/wip/issue548: 1/2] WIP vala: Allow Method.compatible() to be used for expected failures
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue548: 1/2] WIP vala: Allow Method.compatible() to be used for expected failures
- Date: Sat, 1 Dec 2018 14:47:54 +0000 (UTC)
commit 2f8e9d35f9fde22dd810e14b92a2c90e45bec0ec
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Dec 1 14:13:31 2018 +0100
WIP vala: Allow Method.compatible() to be used for expected failures
vala/valasemanticanalyzer.vala | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index 139103b89..5ffb237dd 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -848,6 +848,10 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
var instance_type = get_instance_base_type_for_member (derived_instance_type,
(TypeSymbol) generic_type.type_parameter.parent_symbol, node_reference);
if (instance_type == null) {
+ // allow Method.compatible() to be used for expected failures
+ if (node_reference is Method) {
+ return new InvalidType ();
+ }
CodeNode? reference = get_symbol_for_data_type
(derived_instance_type);
Report.error ((reference ?? node_reference).source_reference, "The
type-parameter `%s' is missing".printf (generic_type.to_string ()));
node_reference.error = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]