[vala/wip/foreach: 6/7] codegen: Report internal error for unsupported collection type in foreach




commit 01f0c36c21e76eb0a6572263f925f7b48212fcb3
Author: Corentin Noël <corentin elementary io>
Date:   Mon Nov 9 13:52:53 2020 +0100

    codegen: Report internal error for unsupported collection type in foreach

 codegen/valaccodecontrolflowmodule.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/codegen/valaccodecontrolflowmodule.vala b/codegen/valaccodecontrolflowmodule.vala
index df31fcef3..dbf64b759 100644
--- a/codegen/valaccodecontrolflowmodule.vala
+++ b/codegen/valaccodecontrolflowmodule.vala
@@ -338,6 +338,10 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule {
                        stmt.body.emit (this);
 
                        ccode.close ();
+               } else {
+                       Report.error (stmt.source_reference, "internal error: unsupported collection type");
+                       stmt.error = true;
+                       return;
                }
 
                foreach (LocalVariable local in stmt.get_local_variables ()) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]