diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-18 19:23:32 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-18 19:23:32 -0300 |
commit | 199baeb498888cc12b1751f689b9bad79f03705f (patch) | |
tree | 1e5a9cca32d80b9e646edf9233534832fd77e9c0 /typesystem.cpp | |
parent | 571a17cfcc76ad5f27fa1627b9ffd90aeb56e554 (diff) |
Fixed error checking about already existing conversion rules.
The error checking that avoids duplicated conversion rules
definitions applies only to general type conversions, not to
cases specified to a function argument.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r-- | typesystem.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index 098a095e9..5d1aef3c2 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -1009,11 +1009,6 @@ bool Handler::startElement(const QString &, const QString &n, return false; } - if (topElement.entry->hasConversionRule()) { - m_error = "Types can have only one conversion rule"; - return false; - } - if (topElement.type == StackElement::ModifyArgument) { static QHash<QString, TypeSystem::Language> languageNames; if (languageNames.isEmpty()) { @@ -1032,6 +1027,10 @@ bool Handler::startElement(const QString &, const QString &n, snip.language = lang; m_functionMods.last().argument_mods.last().conversion_rules.append(snip); } else { + if (topElement.entry->hasConversionRule()) { + m_error = "Types can have only one conversion rule"; + return false; + } QString sourceFile = attributes["file"]; if (sourceFile.isEmpty()) { |