diff options
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index fdfbffba453..044bae97179 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -1304,7 +1304,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) ContainedPtr contained = ContainedPtr::dynamicCast(this); if(contained) { - if (typeError) + if(typeError) { ignoreUndefined = true; } @@ -1322,23 +1322,19 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) } return TypeList(); } - if(typeError && results.empty() && printError) - { - for(vector<string>::const_iterator p = errors.begin(); p != errors.end(); ++p) - { - _unit->error(*p); - } - } - return results; } - else + + // + // Do not emit errors if there was a type error but a match was found in a higher scope. + // + if(printError && !(typeError && !results.empty())) { for(vector<string>::const_iterator p = errors.begin(); p != errors.end(); ++p) { _unit->error(*p); } - return results; } + return results; } ContainedList |