diff --git a/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs b/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs index d014cc5f46f..39867333255 100644 --- a/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs +++ b/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs @@ -58,7 +58,6 @@ public partial class HqlSqlWalker private readonly LiteralProcessor _literalProcessor; private readonly IDictionary _tokenReplacements; - private readonly IDictionary _guessedParameterTypes = new Dictionary(); private JoinType _impliedJoinType; @@ -93,21 +92,6 @@ public override void ReportError(RecognitionException e) _parseErrorHandler.ReportError(e); } - internal IStatement Transform() - { - var tree = (IStatement) statement().Tree; - // Use the guessed type in case we weren't been able to detect the type - foreach (var parameter in _parameters) - { - if (parameter.ExpectedType == null && _guessedParameterTypes.TryGetValue(parameter, out var guessedType)) - { - parameter.ExpectedType = guessedType; - } - } - - return tree; - } - /* protected override void Mismatch(IIntStream input, int ttype, BitSet follow) { @@ -1176,7 +1160,6 @@ IASTNode GenerateNamedParameter(IASTNode delimiterNode, IASTNode nameNode) // when the parameter is used as an argument. if (isGuessedType) { - _guessedParameterTypes[paramSpec] = type; parameter.GuessedType = type; } else diff --git a/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs b/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs index bbf6fdfb48d..6bab2557751 100644 --- a/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs +++ b/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs @@ -651,8 +651,7 @@ public IStatement Translate() try { - // Transform the tree. - _resultAst = hqlSqlWalker.Transform(); + _resultAst = (IStatement) hqlSqlWalker.statement().Tree; } finally {