From 08fabf7acb5aadd037975271692f2411fe0c5a51 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 16 Mar 2023 12:53:55 -0400 Subject: [PATCH] LibIDL: Partially implement distinguishing between interface-like types This is needed for WebAssembly, where we need to distinguish between a BufferSource and a WebAssembly.Module. --- Userland/Libraries/LibIDL/Types.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibIDL/Types.cpp b/Userland/Libraries/LibIDL/Types.cpp index 73faf3e1a6..599f5180c7 100644 --- a/Userland/Libraries/LibIDL/Types.cpp +++ b/Userland/Libraries/LibIDL/Types.cpp @@ -178,11 +178,9 @@ bool Type::is_distinguishable_from(IDL::Type const& other) const auto other_distinguishability = determine_category(other_innermost_type); if (this_distinguishability == DistinguishabilityCategory::InterfaceLike && other_distinguishability == DistinguishabilityCategory::InterfaceLike) { - // Two interface-likes are distinguishable if: - // "The two identified interface-like types are not the same, and no single platform object - // implements both interface-like types." - // FIXME: Implement this. - return false; + // The two identified interface-like types are not the same, and + // FIXME: no single platform object implements both interface-like types. + return this_innermost_type.name() != other_innermost_type.name(); } return table[to_underlying(this_distinguishability)][to_underlying(other_distinguishability)];