code builderCall = builder;
}
+// A type that's buildable iff the type passed as an argument is buildable.
+// This is intended for use by types like container types, which are only
+// buildable if the type of their elements is buildable.
+class SameBuildabilityAs<Type type, code builder> {
+ code builderCall = !if(!empty(type.builderCall), "", builder);
+}
+
// Any type at all.
def AnyType : Type<CPred<"true">, "any type">;
"$_self.cast<::mlir::ComplexType>().getElementType()",
type.predicate>]>,
"complex type with " # type.description # " elements",
- "::mlir::ComplexType"> {
+ "::mlir::ComplexType">,
+ SameBuildabilityAs<type, "::mlir::ComplexType::get($_builder.get" # type #
+ "Type())"> {
Type elementType = type;
}
// -----
func @complex_f64_failure() {
- // expected-error@+1 {{must be complex type with 64-bit float elements}}
+ // expected-error@+1 {{op inferred type incompatible with return type of operation}}
"test.complex_f64"() : () -> (f64)
return
}