[tint][ir] Fail encode instead of ICE'ing for BinaryArray

This is an in progress/prototype feature, so we are not implementing
it in the IR binary yet, but want shaders that use it to just fail
instead of ICE'ing.

Bug: 419314986
Change-Id: Ief8d733c84b3dea311b365aa2cfd36c8f6b2f682
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/243974
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/core/ir/binary/encode.cc b/src/tint/lang/core/ir/binary/encode.cc
index 4b2d902..5dc7ba9 100644
--- a/src/tint/lang/core/ir/binary/encode.cc
+++ b/src/tint/lang/core/ir/binary/encode.cc
@@ -69,6 +69,7 @@
 #include "src/tint/lang/core/ir/var.h"
 #include "src/tint/lang/core/texel_format.h"
 #include "src/tint/lang/core/type/array.h"
+#include "src/tint/lang/core/type/binding_array.h"
 #include "src/tint/lang/core/type/bool.h"
 #include "src/tint/lang/core/type/depth_multisampled_texture.h"
 #include "src/tint/lang/core/type/depth_texture.h"
@@ -427,6 +428,15 @@
                             TINT_ICE() << "invalid subgroup matrix kind: " << ToString(s->Kind());
                     }
                 },
+                [&](const core::type::BindingArray*) {
+                    // There is no 'unknown/unspecified' value to set the type
+                    // to, so just using void, since the encode will fail due to
+                    // writing to err_.
+                    // TODO(crbug.com/419314986): Add BindingArray to ir.proto
+                    //  and implemented encode/decode, once the feature is complete
+                    type_out.set_basic(pb::TypeBasic::void_);
+                    err_ << "BindingType is not currently implemented in IR";
+                },
                 TINT_ICE_ON_NO_MATCH);
 
             mod_out_.mutable_types()->Add(std::move(type_out));