Exemplo n.º 1
0
            private BoundExpression TypeTestAndCopyToTemp(BoundExpression input, BoundExpression temp)
            {
                // invariant: the input has already been tested, to ensure it is not null
                if (input == temp)
                {
                    return(_factory.Literal(true));
                }

                Debug.Assert(temp.Kind == BoundKind.Local);
                return(_localRewriter.MakeIsDeclarationPattern(_factory.Syntax, input, temp, requiresNullTest: false));
            }
Exemplo n.º 2
0
            private BoundExpression TypeTestAndCopyToTemp(BoundExpression input, BoundExpression temp)
            {
                // invariant: the input has already been tested, to ensure it is not null
                if (input == temp)
                {
                    // this may not be reachable due to https://github.com/dotnet/roslyn/issues/16878
                    return(_factory.Literal(true));
                }

                Debug.Assert(temp.Kind == BoundKind.Local);
                return(_localRewriter.MakeIsDeclarationPattern(_factory.Syntax, input, temp, requiresNullTest: false));
            }