Permalink
Browse files

HqlGeneratorExpressionTreeVisitor should process TypeAs expression ty…

…pe in the same way as Convert and ConvertChecked expression types (NH-2463)
  • Loading branch information...
hazzik committed Sep 18, 2012
1 parent bdba4ae commit 2d93b5394329b556654be1adaa698a83c694ef5d
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs
@@ -366,15 +366,14 @@ protected HqlTreeNode VisitUnaryExpression(UnaryExpression expression)
return _hqlTreeBuilder.BooleanNot(VisitExpression(expression.Operand).AsBooleanExpression());
case ExpressionType.Convert:
case ExpressionType.ConvertChecked:
- {
+ case ExpressionType.TypeAs:
if ((expression.Operand.Type.IsPrimitive || expression.Operand.Type == typeof(Decimal)) &&
(expression.Type.IsPrimitive || expression.Type == typeof(Decimal)))
{
return _hqlTreeBuilder.Cast(VisitExpression(expression.Operand).AsExpression(), expression.Type);
}
return VisitExpression(expression.Operand);
- }
}
throw new NotSupportedException(expression.ToString());

0 comments on commit 2d93b53

Please sign in to comment.