Index: flang/lib/Evaluate/characteristics.cpp =================================================================== --- flang/lib/Evaluate/characteristics.cpp +++ flang/lib/Evaluate/characteristics.cpp @@ -257,8 +257,14 @@ coshape == that.coshape; } +static bool AreCompatibleDummyDataObjectShapes(const Shape &x, const Shape &y) { + // TODO: Validate more than just compatible ranks + return GetRank(x) == GetRank(y); +} + bool DummyDataObject::IsCompatibleWith(const DummyDataObject &actual) const { - return type.shape() == actual.type.shape() && + return AreCompatibleDummyDataObjectShapes( + type.shape(), actual.type.shape()) && type.type().IsTkCompatibleWith(actual.type.type()) && attrs == actual.attrs && intent == actual.intent && coshape == actual.coshape;