summaryrefslogtreecommitdiff
path: root/cpp/src/Transform/Data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Transform/Data.cpp')
-rw-r--r--cpp/src/Transform/Data.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/Transform/Data.cpp b/cpp/src/Transform/Data.cpp
index 4950909ba3c..db4c9a73b91 100644
--- a/cpp/src/Transform/Data.cpp
+++ b/cpp/src/Transform/Data.cpp
@@ -753,9 +753,20 @@ Transform::Data::checkClasses(const Slice::ClassDeclPtr& dest, const Slice::Clas
{
return checkClasses(dest, s, interceptor);
}
- else if(dest->unit().get() == src->unit().get())
+
+ if(dest->unit().get() != src->unit().get())
+ {
+ Slice::TypeList l = dest->unit()->lookupTypeNoBuiltin(s2, false);
+ if(l.empty())
+ {
+ _errorReporter->error("class " + s2 + " not found in new Slice definitions");
+ }
+ s = Slice::ClassDeclPtr::dynamicCast(l.front());
+ }
+
+ if(s)
{
- Slice::ClassDefPtr def = src->definition();
+ Slice::ClassDefPtr def = s->definition();
if(!def)
{
_errorReporter->error("class " + s2 + " declared but not defined");