diff --git a/src/composition.cc b/src/composition.cc index ec5e4934..3b0518fc 100644 --- a/src/composition.cc +++ b/src/composition.cc @@ -1275,9 +1275,11 @@ static bool InheritPrimSpecImpl(PrimSpec &dst, const PrimSpec &src, // Then override it with `dst` PrimSpec ps = src; // copy - // Keep PrimSpec name, typeName and spec from `dst` + // Keep PrimSpec name, typeName (if not empty) and spec from `dst` ps.name() = dst.name(); - ps.typeName() = dst.typeName(); + if (!dst.typeName().empty()) { + ps.typeName() = dst.typeName(); + } ps.specifier() = dst.specifier(); // Override metadataum diff --git a/src/prim-types.cc b/src/prim-types.cc index 2dc5afd4..3b95dddf 100644 --- a/src/prim-types.cc +++ b/src/prim-types.cc @@ -2175,7 +2175,8 @@ bool Layer::find_primspec_at(const Path &path, const PrimSpec **ps, auto ret = _primspec_path_cache.find(path.prim_part()); if (ret != _primspec_path_cache.end()) { DCOUT("Found cache."); - return ret->second; + (*ps) = ret->second; + return true; } }