[mlir:SubElementInterfaces] Remove unnecessary static check
authorRiver Riddle <riddleriver@gmail.com>
Mon, 7 Nov 2022 23:13:09 +0000 (15:13 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Mon, 7 Nov 2022 23:13:21 +0000 (15:13 -0800)
We already constrain the template on just attributes/types.

mlir/include/mlir/IR/SubElementInterfaces.h

index 07d246a..2af7642 100644 (file)
@@ -138,8 +138,7 @@ struct AttrTypeSubElementHandler<
       return T();
     if constexpr (std::is_base_of_v<Attribute, T>) {
       return cast<T>(attrRepls.take_front(1)[0]);
-    } else if constexpr (!detail::IsInterface<T>::value &&
-                         std::is_base_of_v<Type, T>) {
+    } else {
       return cast<T>(typeRepls.take_front(1)[0]);
     }
   }