dotvvm
dotvvm copied to clipboard
Possible bug in null propagation visitor on .NET Framework
The following issue has been manifesting quite a lot recently:
Test method DotVVM.Framework.Tests.Binding.NullPropagationTests.BindingNullPropagation_1 threw exception:
System.NotSupportedException: TryExpression is not supported as a child expression when accessing a member on type 'System.TimeSpan' because it is a value type. Construct the tree so the TryExpression is not nested inside of this expression.
at System.Linq.Expressions.Compiler.StackSpiller.RequireNotRefInstance(Expression instance)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteMemberExpression(Expression expr, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteUnaryExpression(Expression expr, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpressionFreeTemps(Expression expression, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.Rewrite[T](Expression`1 lambda)
at System.Linq.Expressions.Expression`1.Accept(StackSpiller spiller)
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator)
at DotVVM.Framework.Tests.Binding.NullPropagationTests.<>c__DisplayClass7_0.<TestExpression>g__compile|2(Expression e) in D:\a\dotvvm\dotvvm\src\Tests\Binding\NullPropagationTests.cs:line 149
at DotVVM.Framework.Tests.Binding.NullPropagationTests.TestExpression(Random rnd, Expression expression, ParameterExpression originalParameter) in D:\a\dotvvm\dotvvm\src\Tests\Binding\NullPropagationTests.cs:line 146
at DotVVM.Framework.Tests.Binding.NullPropagationTests.BindingNullPropagation_1() in D:\a\dotvvm\dotvvm\src\Tests\Binding\NullPropagationTests.cs:line 272
It is not deterministic - but I think it is failing during at least 1 in 4 runs. Moreover, I think it is only failing for Windows (.NET Framework) unit tests project. I am not sure whether it is a buggy test or a bug in the visitor itself.