first move to lazy type.

first move to lazy type.

--- src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
+++ src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
@@ -1,5 +1,6 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

+using System;
 using System.Collections.Immutable;
 using System.Linq;
 using Microsoft.CodeAnalysis.CSharp;
@@ -167,17 +168,17 @@
         private static IInvocationExpression CreateBoundCallOperation(BoundCall boundCall)
         {
             IMethodSymbol targetMethod = boundCall.Method;
-            IOperation instance = ((object)boundCall.Method == null || boundCall.Method.IsStatic) ? null : boundCall.ReceiverOpt;
+            Lazy<IOperation> instance = new Lazy<IOperation>(() => ((object)boundCall.Method == null || boundCall.Method.IsStatic) ? null : boundCall.ReceiverOpt);
             bool isVirtual = (object)boundCall.Method != null &&
                         boundCall.ReceiverOpt != null &&
                         (boundCall.Method.IsVirtual || boundCall.Method.IsAbstract || boundCall.Method.IsOverride) &&
                         !boundCall.ReceiverOpt.SuppressVirtualCalls;
-            ImmutableArray<IArgument> argumentsInSourceOrder = ((IInvocationExpression)boundCall).ArgumentsInSourceOrder /* MANUAL */;
+            Lazy<ImmutableArray<IArgument>> argumentsInSourceOrder = new Lazy<ImmutableArray<IArgument>>(() => ((IInvocationExpression)boundCall).ArgumentsInSourceOrder /* MANUAL */);
             bool isInvalid = boundCall.HasErrors;
             SyntaxNode syntax = boundCall.Syntax;
             ITypeSymbol type = boundCall.Type;
             Optional<object> constantValue = ConvertToOptional(boundCall.ConstantValue);
-            return new InvocationExpression(targetMethod, instance, isVirtual, argumentsInSourceOrder, isInvalid, syntax, type, constantValue);
+            return new LazyInvocationExpression(targetMethod, instance, isVirtual, argumentsInSourceOrder, isInvalid, syntax, type, constantValue);
         }
         private static ILocalReferenceExpression CreateBoundLocalOperation(BoundLocal boundLocal)
         {
@@ -191,58 +192,58 @@
         private static IFieldReferenceExpression CreateBoundFieldAccessOperation(BoundFieldAccess boundFieldAccess)
         {
             IFieldSymbol field = boundFieldAccess.FieldSymbol;
-            IOperation instance = boundFieldAccess.FieldSymbol.IsStatic ? null : boundFieldAccess.ReceiverOpt;
+            Lazy<IOperation> instance = new Lazy<IOperation>(() => boundFieldAccess.FieldSymbol.IsStatic ? null : boundFieldAccess.ReceiverOpt);
             ISymbol member = boundFieldAccess.FieldSymbol;
             bool isInvalid = boundFieldAccess.HasErrors;
             SyntaxNode syntax = boundFieldAccess.Syntax;
             ITypeSymbol type = boundFieldAccess.Type;
             Optional<object> constantValue = ConvertToOptional(boundFieldAccess.ConstantValue);
-            return new FieldReferenceExpression(field, instance, member, isInvalid, syntax, type, constantValue);
+            return new LazyFieldReferenceExpression(field, instance, member, isInvalid, syntax, type, constantValue);
         }
         private static IPropertyReferenceExpression CreateBoundPropertyAccessOperation(BoundPropertyAccess boundPropertyAccess)
         {
             IPropertySymbol property = boundPropertyAccess.PropertySymbol;
-            IOperation instance = boundPropertyAccess.PropertySymbol.IsStatic ? null : boundPropertyAccess.ReceiverOpt;
+            Lazy<IOperation> instance = new Lazy<IOperation>(() => boundPropertyAccess.PropertySymbol.IsStatic ? null : boundPropertyAccess.ReceiverOpt);
             ISymbol member = boundPropertyAccess.PropertySymbol;
             bool isInvalid = boundPropertyAccess.HasErrors;
             SyntaxNode syntax = boundPropertyAccess.Syntax;
             ITypeSymbol type = boundPropertyAccess.Type;
             Optional<object> constantValue = ConvertToOptional(boundPropertyAccess.ConstantValue);
-            return new IndexedPropertyReferenceExpression(property, instance, member, isInvalid, syntax, type, constantValue);
+            return new LazyIndexedPropertyReferenceExpression(property, instance, member, isInvalid, syntax, type, constantValue);
         }
         private static IIndexedPropertyReferenceExpression CreateBoundIndexerAccessOperation(BoundIndexerAccess boundIndexerAccess)
         {
             IPropertySymbol property = boundIndexerAccess.Indexer;
-            IOperation instance = boundIndexerAccess.Indexer.IsStatic ? null : boundIndexerAccess.ReceiverOpt;
+            Lazy<IOperation> instance = new Lazy<IOperation>(() => boundIndexerAccess.Indexer.IsStatic ? null : boundIndexerAccess.ReceiverOpt);
             ISymbol member = boundIndexerAccess.Indexer;
             bool isInvalid = boundIndexerAccess.HasErrors;
             SyntaxNode syntax = boundIndexerAccess.Syntax;
             ITypeSymbol type = boundIndexerAccess.Type;
             Optional<object> constantValue = ConvertToOptional(boundIndexerAccess.ConstantValue);
-            return new IndexedPropertyReferenceExpression(property, instance, member, isInvalid, syntax, type, constantValue);
+            return new LazyIndexedPropertyReferenceExpression(property, instance, member, isInvalid, syntax, type, constantValue);
         }
         private static IEventReferenceExpression CreateBoundEventAccessOperation(BoundEventAccess boundEventAccess)
         {
             IEventSymbol @event = boundEventAccess.EventSymbol;
-            IOperation instance = boundEventAccess.EventSymbol.IsStatic ? null : boundEventAccess.ReceiverOpt;
+            Lazy<IOperation> instance = new Lazy<IOperation>(() => boundEventAccess.EventSymbol.IsStatic ? null : boundEventAccess.ReceiverOpt);
             ISymbol member = boundEventAccess.EventSymbol;
             bool isInvalid = boundEventAccess.HasErrors;
             SyntaxNode syntax = boundEventAccess.Syntax;
             ITypeSymbol type = boundEventAccess.Type;
             Optional<object> constantValue = ConvertToOptional(boundEventAccess.ConstantValue);
-            return new EventReferenceExpression(@event, instance, member, isInvalid, syntax, type, constantValue);
+            return new LazyEventReferenceExpression(@event, instance, member, isInvalid, syntax, type, constantValue);
         }
         private static IEventAssignmentExpression CreateBoundEventAssignmentOperatorOperation(BoundEventAssignmentOperator boundEventAssignmentOperator)
         {
             IEventSymbol @event = boundEventAssignmentOperator.Event;
-            IOperation eventInstance = boundEventAssignmentOperator.Event.IsStatic ? null : boundEventAssignmentOperator.ReceiverOpt;
-            IOperation handlerValue = boundEventAssignmentOperator.Argument;
+            Lazy<IOperation> eventInstance = new Lazy<IOperation>(() => boundEventAssignmentOperator.Event.IsStatic ? null : boundEventAssignmentOperator.ReceiverOpt);
+            Lazy<IOperation> handlerValue = new Lazy<IOperation>(() => boundEventAssignmentOperator.Argument);
             bool adds = boundEventAssignmentOperator.IsAddition;
             bool isInvalid = boundEventAssignmentOperator.HasErrors;
             SyntaxNode syntax = boundEventAssignmentOperator.Syntax;
             ITypeSymbol type = boundEventAssignmentOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundEventAssignmentOperator.ConstantValue);
-            return new EventAssignmentExpression(@event, eventInstance, handlerValue, adds, isInvalid, syntax, type, constantValue);
+            return new LazyEventAssignmentExpression(@event, eventInstance, handlerValue, adds, isInvalid, syntax, type, constantValue);
         }
         private static IMethodBindingExpression CreateBoundDelegateCreationExpressionOperation(BoundDelegateCreationExpression boundDelegateCreationExpression)
         {
@@ -250,13 +251,13 @@
             bool isVirtual = (object)boundDelegateCreationExpression.MethodOpt != null &&
                         (boundDelegateCreationExpression.MethodOpt.IsVirtual || boundDelegateCreationExpression.MethodOpt.IsAbstract || boundDelegateCreationExpression.MethodOpt.IsOverride) &&
                         !boundDelegateCreationExpression.SuppressVirtualCalls;
-            IOperation instance = ((IMemberReferenceExpression)boundDelegateCreationExpression).Instance /* MANUAL */;
+            Lazy<IOperation> instance = new Lazy<IOperation>(() => ((IMemberReferenceExpression)boundDelegateCreationExpression).Instance /* MANUAL */);
             ISymbol member = boundDelegateCreationExpression.MethodOpt;
             bool isInvalid = boundDelegateCreationExpression.HasErrors;
             SyntaxNode syntax = boundDelegateCreationExpression.Argument.Syntax;
             ITypeSymbol type = boundDelegateCreationExpression.Type;
             Optional<object> constantValue = ConvertToOptional(boundDelegateCreationExpression.ConstantValue);
-            return new MethodBindingExpression(method, isVirtual, instance, member, isInvalid, syntax, type, constantValue);
+            return new LazyMethodBindingExpression(method, isVirtual, instance, member, isInvalid, syntax, type, constantValue);
         }
         private static IParameterReferenceExpression CreateBoundParameterOperation(BoundParameter boundParameter)
         {
@@ -279,12 +280,12 @@
         private static IObjectCreationExpression CreateBoundObjectCreationExpressionOperation(BoundObjectCreationExpression boundObjectCreationExpression)
         {
             IMethodSymbol constructor = boundObjectCreationExpression.Constructor;
-            ImmutableArray<ISymbolInitializer> memberInitializers = ((IObjectCreationExpression)boundObjectCreationExpression).MemberInitializers /* MANUAL */;
+            Lazy<ImmutableArray<ISymbolInitializer>> memberInitializers = new Lazy<ImmutableArray<ISymbolInitializer>>(() => ((IObjectCreationExpression)boundObjectCreationExpression).MemberInitializers /* MANUAL */);
             bool isInvalid = boundObjectCreationExpression.HasErrors;
             SyntaxNode syntax = boundObjectCreationExpression.Syntax;
             ITypeSymbol type = boundObjectCreationExpression.Type;
             Optional<object> constantValue = ConvertToOptional(boundObjectCreationExpression.ConstantValue);
-            return new ObjectCreationExpression(constructor, memberInitializers, isInvalid, syntax, type, constantValue);
+            return new LazyObjectCreationExpression(constructor, memberInitializers, isInvalid, syntax, type, constantValue);
         }
         private static IUnboundLambdaExpression CreateUnboundLambdaOperation(UnboundLambda unboundLambda)
         {
@@ -297,16 +298,16 @@
         private static ILambdaExpression CreateBoundLambdaOperation(BoundLambda boundLambda)
         {
             IMethodSymbol signature = boundLambda.Symbol;
-            IBlockStatement body = boundLambda.Body;
+            Lazy<IBlockStatement> body = new Lazy<IBlockStatement>(() => boundLambda.Body);
             bool isInvalid = boundLambda.HasErrors;
             SyntaxNode syntax = boundLambda.Syntax;
             ITypeSymbol type = boundLambda.Type;
             Optional<object> constantValue = ConvertToOptional(boundLambda.ConstantValue);
-            return new LambdaExpression(signature, body, isInvalid, syntax, type, constantValue);
+            return new LazyLambdaExpression(signature, body, isInvalid, syntax, type, constantValue);
         }
         private static IConversionExpression CreateBoundConversionOperation(BoundConversion boundConversion)
         {
-            IOperation operand = boundConversion.Operand;
+            Lazy<IOperation> operand = new Lazy<IOperation>(() => boundConversion.Operand);
             ConversionKind conversionKind = ((IConversionExpression)boundConversion).ConversionKind /* MANUAL */;
             bool isExplicit = boundConversion.ExplicitCastInCode;
             bool usesOperatorMethod = boundConversion.ConversionKind == CSharp.ConversionKind.ExplicitUserDefined || boundConversion.ConversionKind == CSharp.ConversionKind.ImplicitUserDefined;
@@ -315,11 +316,11 @@
             SyntaxNode syntax = boundConversion.Syntax;
             ITypeSymbol type = boundConversion.Type;
             Optional<object> constantValue = ConvertToOptional(boundConversion.ConstantValue);
-            return new ConversionExpression(operand, conversionKind, isExplicit, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
+            return new LazyConversionExpression(operand, conversionKind, isExplicit, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
         }
         private static IConversionExpression CreateBoundAsOperatorOperation(BoundAsOperator boundAsOperator)
         {
-            IOperation operand = boundAsOperator.Operand;
+            Lazy<IOperation> operand = new Lazy<IOperation>(() => boundAsOperator.Operand);
             ConversionKind conversionKind = Semantics.ConversionKind.TryCast;
             bool isExplicit = true;
             bool usesOperatorMethod = false;
@@ -328,17 +329,17 @@
             SyntaxNode syntax = boundAsOperator.Syntax;
             ITypeSymbol type = boundAsOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundAsOperator.ConstantValue);
-            return new ConversionExpression(operand, conversionKind, isExplicit, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
+            return new LazyConversionExpression(operand, conversionKind, isExplicit, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
         }
         private static IIsTypeExpression CreateBoundIsOperatorOperation(BoundIsOperator boundIsOperator)
         {
-            IOperation operand = boundIsOperator.Operand;
+            Lazy<IOperation> operand = new Lazy<IOperation>(() => boundIsOperator.Operand);
             ITypeSymbol isType = boundIsOperator.TargetType.Type;
             bool isInvalid = boundIsOperator.HasErrors;
             SyntaxNode syntax = boundIsOperator.Syntax;
             ITypeSymbol type = boundIsOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundIsOperator.ConstantValue);
-            return new IsTypeExpression(operand, isType, isInvalid, syntax, type, constantValue);
+            return new LazyIsTypeExpression(operand, isType, isInvalid, syntax, type, constantValue);
         }
         private static ISizeOfExpression CreateBoundSizeOfOperatorOperation(BoundSizeOfOperator boundSizeOfOperator)
         {
@@ -361,22 +362,22 @@
         private static IArrayCreationExpression CreateBoundArrayCreationOperation(BoundArrayCreation boundArrayCreation)
         {
             ITypeSymbol elementType = ((IArrayCreationExpression)boundArrayCreation).ElementType /* MANUAL */;
-            ImmutableArray<IOperation> dimensionSizes = boundArrayCreation.Bounds.As<IOperation>();
-            IArrayInitializer initializer = boundArrayCreation.InitializerOpt;
+            Lazy<ImmutableArray<IOperation>> dimensionSizes = new Lazy<ImmutableArray<IOperation>>(() => boundArrayCreation.Bounds.As<IOperation>());
+            Lazy<IArrayInitializer> initializer = new Lazy<IArrayInitializer>(() => boundArrayCreation.InitializerOpt);
             bool isInvalid = boundArrayCreation.HasErrors;
             SyntaxNode syntax = boundArrayCreation.Syntax;
             ITypeSymbol type = boundArrayCreation.Type;
             Optional<object> constantValue = ConvertToOptional(boundArrayCreation.ConstantValue);
-            return new ArrayCreationExpression(elementType, dimensionSizes, initializer, isInvalid, syntax, type, constantValue);
+            return new LazyArrayCreationExpression(elementType, dimensionSizes, initializer, isInvalid, syntax, type, constantValue);
         }
         private static IArrayInitializer CreateBoundArrayInitializationOperation(BoundArrayInitialization boundArrayInitialization)
         {
-            ImmutableArray<IOperation> elementValues = boundArrayInitialization.Initializers.As<IOperation>();
+            Lazy<ImmutableArray<IOperation>> elementValues = new Lazy<ImmutableArray<IOperation>>(() => boundArrayInitialization.Initializers.As<IOperation>());
             bool isInvalid = boundArrayInitialization.HasErrors;
             SyntaxNode syntax = boundArrayInitialization.Syntax;
             ITypeSymbol type = boundArrayInitialization.Type;
             Optional<object> constantValue = ConvertToOptional(boundArrayInitialization.ConstantValue);
-            return new ArrayInitializer(elementValues, isInvalid, syntax, type, constantValue);
+            return new LazyArrayInitializer(elementValues, isInvalid, syntax, type, constantValue);
         }
         private static IDefaultValueExpression CreateBoundDefaultOperatorOperation(BoundDefaultOperator boundDefaultOperator)
         {
@@ -406,40 +407,40 @@
         }
         private static IAssignmentExpression CreateBoundAssignmentOperatorOperation(BoundAssignmentOperator boundAssignmentOperator)
         {
-            IOperation target = boundAssignmentOperator.Left;
-            IOperation value = boundAssignmentOperator.Right;
+            Lazy<IOperation> target = new Lazy<IOperation>(() => boundAssignmentOperator.Left);
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundAssignmentOperator.Right);
             bool isInvalid = boundAssignmentOperator.HasErrors;
             SyntaxNode syntax = boundAssignmentOperator.Syntax;
             ITypeSymbol type = boundAssignmentOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundAssignmentOperator.ConstantValue);
-            return new AssignmentExpression(target, value, isInvalid, syntax, type, constantValue);
+            return new LazyAssignmentExpression(target, value, isInvalid, syntax, type, constantValue);
         }
         private static ICompoundAssignmentExpression CreateBoundCompoundAssignmentOperatorOperation(BoundCompoundAssignmentOperator boundCompoundAssignmentOperator)
         {
             BinaryOperationKind binaryOperationKind = CSharp.Expression.DeriveBinaryOperationKind(boundCompoundAssignmentOperator.Operator.Kind);
-            IOperation target = boundCompoundAssignmentOperator.Left;
-            IOperation value = boundCompoundAssignmentOperator.Right;
+            Lazy<IOperation> target = new Lazy<IOperation>(() => boundCompoundAssignmentOperator.Left);
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundCompoundAssignmentOperator.Right);
             bool usesOperatorMethod = (boundCompoundAssignmentOperator.Operator.Kind & BinaryOperatorKind.TypeMask) == BinaryOperatorKind.UserDefined;
             IMethodSymbol operatorMethod = boundCompoundAssignmentOperator.Operator.Method;
             bool isInvalid = boundCompoundAssignmentOperator.HasErrors;
             SyntaxNode syntax = boundCompoundAssignmentOperator.Syntax;
             ITypeSymbol type = boundCompoundAssignmentOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundCompoundAssignmentOperator.ConstantValue);
-            return new CompoundAssignmentExpression(binaryOperationKind, target, value, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
+            return new LazyCompoundAssignmentExpression(binaryOperationKind, target, value, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
         }
         private static IIncrementExpression CreateBoundIncrementOperatorOperation(BoundIncrementOperator boundIncrementOperator)
         {
             UnaryOperationKind incrementOperationKind = CSharp.Expression.DeriveUnaryOperationKind(boundIncrementOperator.OperatorKind);
             BinaryOperationKind binaryOperationKind = CSharp.Expression.DeriveBinaryOperationKind(incrementOperationKind);
-            IOperation target = boundIncrementOperator.Operand;
-            IOperation value = CreateIncrementOneLiteralExpression(boundIncrementOperator);
+            Lazy<IOperation> target = new Lazy<IOperation>(() => boundIncrementOperator.Operand);
+            Lazy<IOperation> value = new Lazy<IOperation>(() => CreateIncrementOneLiteralExpression(boundIncrementOperator));
             bool usesOperatorMethod = (boundIncrementOperator.OperatorKind & UnaryOperatorKind.TypeMask) == UnaryOperatorKind.UserDefined;
             IMethodSymbol operatorMethod = boundIncrementOperator.MethodOpt;
             bool isInvalid = boundIncrementOperator.HasErrors;
             SyntaxNode syntax = boundIncrementOperator.Syntax;
             ITypeSymbol type = boundIncrementOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundIncrementOperator.ConstantValue);
-            return new IncrementExpression(incrementOperationKind, binaryOperationKind, target, value, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
+            return new LazyIncrementExpression(incrementOperationKind, binaryOperationKind, target, value, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
         }
         private static IInvalidExpression CreateBoundBadExpressionOperation(BoundBadExpression boundBadExpression)
         {
@@ -460,85 +461,85 @@
         private static IUnaryOperatorExpression CreateBoundUnaryOperatorOperation(BoundUnaryOperator boundUnaryOperator)
         {
             UnaryOperationKind unaryOperationKind = CSharp.Expression.DeriveUnaryOperationKind(boundUnaryOperator.OperatorKind);
-            IOperation operand = boundUnaryOperator.Operand;
+            Lazy<IOperation> operand = new Lazy<IOperation>(() => boundUnaryOperator.Operand);
             bool usesOperatorMethod = (boundUnaryOperator.OperatorKind & UnaryOperatorKind.TypeMask) == UnaryOperatorKind.UserDefined;
             IMethodSymbol operatorMethod = boundUnaryOperator.MethodOpt;
             bool isInvalid = boundUnaryOperator.HasErrors;
             SyntaxNode syntax = boundUnaryOperator.Syntax;
             ITypeSymbol type = boundUnaryOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundUnaryOperator.ConstantValue);
-            return new UnaryOperatorExpression(unaryOperationKind, operand, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
+            return new LazyUnaryOperatorExpression(unaryOperationKind, operand, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
         }
         private static IBinaryOperatorExpression CreateBoundBinaryOperatorOperation(BoundBinaryOperator boundBinaryOperator)
         {
             BinaryOperationKind binaryOperationKind = CSharp.Expression.DeriveBinaryOperationKind(boundBinaryOperator.OperatorKind);
-            IOperation leftOperand = boundBinaryOperator.Left;
-            IOperation rightOperand = boundBinaryOperator.Right;
+            Lazy<IOperation> leftOperand = new Lazy<IOperation>(() => boundBinaryOperator.Left);
+            Lazy<IOperation> rightOperand = new Lazy<IOperation>(() => boundBinaryOperator.Right);
             bool usesOperatorMethod = (boundBinaryOperator.OperatorKind & BinaryOperatorKind.TypeMask) == BinaryOperatorKind.UserDefined;
             IMethodSymbol operatorMethod = boundBinaryOperator.MethodOpt;
             bool isInvalid = boundBinaryOperator.HasErrors;
             SyntaxNode syntax = boundBinaryOperator.Syntax;
             ITypeSymbol type = boundBinaryOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundBinaryOperator.ConstantValue);
-            return new BinaryOperatorExpression(binaryOperationKind, leftOperand, rightOperand, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
+            return new LazyBinaryOperatorExpression(binaryOperationKind, leftOperand, rightOperand, usesOperatorMethod, operatorMethod, isInvalid, syntax, type, constantValue);
         }
         private static IConditionalChoiceExpression CreateBoundConditionalOperatorOperation(BoundConditionalOperator boundConditionalOperator)
         {
-            IOperation condition = boundConditionalOperator.Condition;
-            IOperation ifTrueValue = boundConditionalOperator.Consequence;
-            IOperation ifFalseValue = boundConditionalOperator.Alternative;
+            Lazy<IOperation> condition = new Lazy<IOperation>(() => boundConditionalOperator.Condition);
+            Lazy<IOperation> ifTrueValue = new Lazy<IOperation>(() => boundConditionalOperator.Consequence);
+            Lazy<IOperation> ifFalseValue = new Lazy<IOperation>(() => boundConditionalOperator.Alternative);
             bool isInvalid = boundConditionalOperator.HasErrors;
             SyntaxNode syntax = boundConditionalOperator.Syntax;
             ITypeSymbol type = boundConditionalOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundConditionalOperator.ConstantValue);
-            return new ConditionalChoiceExpression(condition, ifTrueValue, ifFalseValue, isInvalid, syntax, type, constantValue);
+            return new LazyConditionalChoiceExpression(condition, ifTrueValue, ifFalseValue, isInvalid, syntax, type, constantValue);
         }
         private static INullCoalescingExpression CreateBoundNullCoalescingOperatorOperation(BoundNullCoalescingOperator boundNullCoalescingOperator)
         {
-            IOperation primaryOperand = boundNullCoalescingOperator.LeftOperand;
-            IOperation secondaryOperand = boundNullCoalescingOperator.RightOperand;
+            Lazy<IOperation> primaryOperand = new Lazy<IOperation>(() => boundNullCoalescingOperator.LeftOperand);
+            Lazy<IOperation> secondaryOperand = new Lazy<IOperation>(() => boundNullCoalescingOperator.RightOperand);
             bool isInvalid = boundNullCoalescingOperator.HasErrors;
             SyntaxNode syntax = boundNullCoalescingOperator.Syntax;
             ITypeSymbol type = boundNullCoalescingOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundNullCoalescingOperator.ConstantValue);
-            return new NullCoalescingExpression(primaryOperand, secondaryOperand, isInvalid, syntax, type, constantValue);
+            return new LazyNullCoalescingExpression(primaryOperand, secondaryOperand, isInvalid, syntax, type, constantValue);
         }
         private static IAwaitExpression CreateBoundAwaitExpressionOperation(BoundAwaitExpression boundAwaitExpression)
         {
-            IOperation awaitedValue = boundAwaitExpression.Expression;
+            Lazy<IOperation> awaitedValue = new Lazy<IOperation>(() => boundAwaitExpression.Expression);
             bool isInvalid = boundAwaitExpression.HasErrors;
             SyntaxNode syntax = boundAwaitExpression.Syntax;
             ITypeSymbol type = boundAwaitExpression.Type;
             Optional<object> constantValue = ConvertToOptional(boundAwaitExpression.ConstantValue);
-            return new AwaitExpression(awaitedValue, isInvalid, syntax, type, constantValue);
+            return new LazyAwaitExpression(awaitedValue, isInvalid, syntax, type, constantValue);
         }
         private static IArrayElementReferenceExpression CreateBoundArrayAccessOperation(BoundArrayAccess boundArrayAccess)
         {
-            IOperation arrayReference = boundArrayAccess.Expression;
-            ImmutableArray<IOperation> indices = boundArrayAccess.Indices.As<IOperation>();
+            Lazy<IOperation> arrayReference = new Lazy<IOperation>(() => boundArrayAccess.Expression);
+            Lazy<ImmutableArray<IOperation>> indices = new Lazy<ImmutableArray<IOperation>>(() => boundArrayAccess.Indices.As<IOperation>());
             bool isInvalid = boundArrayAccess.HasErrors;
             SyntaxNode syntax = boundArrayAccess.Syntax;
             ITypeSymbol type = boundArrayAccess.Type;
             Optional<object> constantValue = ConvertToOptional(boundArrayAccess.ConstantValue);
-            return new ArrayElementReferenceExpression(arrayReference, indices, isInvalid, syntax, type, constantValue);
+            return new LazyArrayElementReferenceExpression(arrayReference, indices, isInvalid, syntax, type, constantValue);
         }
         private static IPointerIndirectionReferenceExpression CreateBoundPointerIndirectionOperatorOperation(BoundPointerIndirectionOperator boundPointerIndirectionOperator)
         {
-            IOperation pointer = boundPointerIndirectionOperator.Operand;
+            Lazy<IOperation> pointer = new Lazy<IOperation>(() => boundPointerIndirectionOperator.Operand);
             bool isInvalid = boundPointerIndirectionOperator.HasErrors;
             SyntaxNode syntax = boundPointerIndirectionOperator.Syntax;
             ITypeSymbol type = boundPointerIndirectionOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundPointerIndirectionOperator.ConstantValue);
-            return new PointerIndirectionReferenceExpression(pointer, isInvalid, syntax, type, constantValue);
+            return new LazyPointerIndirectionReferenceExpression(pointer, isInvalid, syntax, type, constantValue);
         }
         private static IAddressOfExpression CreateBoundAddressOfOperatorOperation(BoundAddressOfOperator boundAddressOfOperator)
         {
-            IOperation reference = boundAddressOfOperator.Operand;
+            Lazy<IOperation> reference = new Lazy<IOperation>(() => boundAddressOfOperator.Operand);
             bool isInvalid = boundAddressOfOperator.HasErrors;
             SyntaxNode syntax = boundAddressOfOperator.Syntax;
             ITypeSymbol type = boundAddressOfOperator.Type;
             Optional<object> constantValue = ConvertToOptional(boundAddressOfOperator.ConstantValue);
-            return new AddressOfExpression(reference, isInvalid, syntax, type, constantValue);
+            return new LazyAddressOfExpression(reference, isInvalid, syntax, type, constantValue);
         }
         private static IInstanceReferenceExpression CreateBoundImplicitReceiverOperation(BoundImplicitReceiver boundImplicitReceiver)
         {
@@ -551,13 +552,13 @@
         }
         private static IConditionalAccessExpression CreateBoundConditionalAccessOperation(BoundConditionalAccess boundConditionalAccess)
         {
-            IOperation conditionalValue = boundConditionalAccess.AccessExpression;
-            IOperation conditionalInstance = boundConditionalAccess.Receiver;
+            Lazy<IOperation> conditionalValue = new Lazy<IOperation>(() => boundConditionalAccess.AccessExpression);
+            Lazy<IOperation> conditionalInstance = new Lazy<IOperation>(() => boundConditionalAccess.Receiver);
             bool isInvalid = boundConditionalAccess.HasErrors;
             SyntaxNode syntax = boundConditionalAccess.Syntax;
             ITypeSymbol type = boundConditionalAccess.Type;
             Optional<object> constantValue = ConvertToOptional(boundConditionalAccess.ConstantValue);
-            return new ConditionalAccessExpression(conditionalValue, conditionalInstance, isInvalid, syntax, type, constantValue);
+            return new LazyConditionalAccessExpression(conditionalValue, conditionalInstance, isInvalid, syntax, type, constantValue);
         }
         private static IConditionalAccessInstanceExpression CreateBoundConditionalReceiverOperation(BoundConditionalReceiver boundConditionalReceiver)
         {
@@ -570,45 +571,45 @@
         private static IFieldInitializer CreateBoundFieldEqualsValueOperation(BoundFieldEqualsValue boundFieldEqualsValue)
         {
             ImmutableArray<IFieldSymbol> initializedFields = ImmutableArray.Create<IFieldSymbol>(boundFieldEqualsValue.Field);
-            IOperation value = boundFieldEqualsValue.Value;
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundFieldEqualsValue.Value);
             OperationKind kind = OperationKind.FieldInitializerAtDeclaration;
             bool isInvalid = ((IOperation)boundFieldEqualsValue.Value).IsInvalid;
             SyntaxNode syntax = boundFieldEqualsValue.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new FieldInitializer(initializedFields, value, kind, isInvalid, syntax, type, constantValue);
+            return new LazyFieldInitializer(initializedFields, value, kind, isInvalid, syntax, type, constantValue);
         }
         private static IPropertyInitializer CreateBoundPropertyEqualsValueOperation(BoundPropertyEqualsValue boundPropertyEqualsValue)
         {
             IPropertySymbol initializedProperty = boundPropertyEqualsValue.Property;
-            IOperation value = boundPropertyEqualsValue.Value;
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundPropertyEqualsValue.Value);
             OperationKind kind = OperationKind.PropertyInitializerAtDeclaration;
             bool isInvalid = ((IOperation)boundPropertyEqualsValue.Value).IsInvalid;
             SyntaxNode syntax = boundPropertyEqualsValue.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new PropertyInitializer(initializedProperty, value, kind, isInvalid, syntax, type, constantValue);
+            return new LazyPropertyInitializer(initializedProperty, value, kind, isInvalid, syntax, type, constantValue);
         }
         private static IParameterInitializer CreateBoundParameterEqualsValueOperation(BoundParameterEqualsValue boundParameterEqualsValue)
         {
             IParameterSymbol parameter = boundParameterEqualsValue.Parameter;
-            IOperation value = boundParameterEqualsValue.Value;
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundParameterEqualsValue.Value);
             OperationKind kind = OperationKind.ParameterInitializerAtDeclaration;
             bool isInvalid = ((IOperation)boundParameterEqualsValue.Value).IsInvalid;
             SyntaxNode syntax = boundParameterEqualsValue.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ParameterInitializer(parameter, value, kind, isInvalid, syntax, type, constantValue);
+            return new LazyParameterInitializer(parameter, value, kind, isInvalid, syntax, type, constantValue);
         }
         private static IBlockStatement CreateBoundBlockOperation(BoundBlock boundBlock)
         {
-            ImmutableArray<IOperation> statements = ((IBlockStatement)boundBlock).Statements /* MANUAL */;
+            Lazy<ImmutableArray<IOperation>> statements = new Lazy<ImmutableArray<IOperation>>(() => ((IBlockStatement)boundBlock).Statements /* MANUAL */);
             ImmutableArray<ILocalSymbol> locals = boundBlock.Locals.As<ILocalSymbol>();
             bool isInvalid = boundBlock.HasErrors;
             SyntaxNode syntax = boundBlock.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new BlockStatement(statements, locals, isInvalid, syntax, type, constantValue);
+            return new LazyBlockStatement(statements, locals, isInvalid, syntax, type, constantValue);
         }
         private static IBranchStatement CreateBoundContinueStatementOperation(BoundContinueStatement boundContinueStatement)
         {
@@ -632,12 +633,12 @@
         }
         private static IReturnStatement CreateBoundYieldBreakStatementOperation(BoundYieldBreakStatement boundYieldBreakStatement)
         {
-            IOperation returnedValue = null;
+            Lazy<IOperation> returnedValue = new Lazy<IOperation>(() => null);
             bool isInvalid = boundYieldBreakStatement.HasErrors;
             SyntaxNode syntax = boundYieldBreakStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ReturnStatement(returnedValue, isInvalid, syntax, type, constantValue);
+            return new LazyReturnStatement(returnedValue, isInvalid, syntax, type, constantValue);
         }
         private static IBranchStatement CreateBoundGotoStatementOperation(BoundGotoStatement boundGotoStatement)
         {
@@ -659,170 +660,170 @@
         }
         private static IIfStatement CreateBoundIfStatementOperation(BoundIfStatement boundIfStatement)
         {
-            IOperation condition = boundIfStatement.Condition;
-            IOperation ifTrueStatement = boundIfStatement.Consequence;
-            IOperation ifFalseStatement = boundIfStatement.AlternativeOpt;
+            Lazy<IOperation> condition = new Lazy<IOperation>(() => boundIfStatement.Condition);
+            Lazy<IOperation> ifTrueStatement = new Lazy<IOperation>(() => boundIfStatement.Consequence);
+            Lazy<IOperation> ifFalseStatement = new Lazy<IOperation>(() => boundIfStatement.AlternativeOpt);
             bool isInvalid = boundIfStatement.HasErrors;
             SyntaxNode syntax = boundIfStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new IfStatement(condition, ifTrueStatement, ifFalseStatement, isInvalid, syntax, type, constantValue);
+            return new LazyIfStatement(condition, ifTrueStatement, ifFalseStatement, isInvalid, syntax, type, constantValue);
         }
         private static IWhileUntilLoopStatement CreateBoundWhileStatementOperation(BoundWhileStatement boundWhileStatement)
         {
             bool isTopTest = true;
             bool isWhile = true;
-            IOperation condition = boundWhileStatement.Condition;
+            Lazy<IOperation> condition = new Lazy<IOperation>(() => boundWhileStatement.Condition);
             LoopKind loopKind = LoopKind.WhileUntil;
-            IOperation body = boundWhileStatement.Body;
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundWhileStatement.Body);
             bool isInvalid = boundWhileStatement.HasErrors;
             SyntaxNode syntax = boundWhileStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new WhileUntilLoopStatement(isTopTest, isWhile, condition, loopKind, body, isInvalid, syntax, type, constantValue);
+            return new LazyWhileUntilLoopStatement(isTopTest, isWhile, condition, loopKind, body, isInvalid, syntax, type, constantValue);
         }
         private static IWhileUntilLoopStatement CreateBoundDoStatementOperation(BoundDoStatement boundDoStatement)
         {
             bool isTopTest = false;
             bool isWhile = true;
-            IOperation condition = boundDoStatement.Condition;
+            Lazy<IOperation> condition = new Lazy<IOperation>(() => boundDoStatement.Condition);
             LoopKind loopKind = LoopKind.WhileUntil;
-            IOperation body = boundDoStatement.Body;
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundDoStatement.Body);
             bool isInvalid = boundDoStatement.HasErrors;
             SyntaxNode syntax = boundDoStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new WhileUntilLoopStatement(isTopTest, isWhile, condition, loopKind, body, isInvalid, syntax, type, constantValue);
+            return new LazyWhileUntilLoopStatement(isTopTest, isWhile, condition, loopKind, body, isInvalid, syntax, type, constantValue);
         }
         private static IForLoopStatement CreateBoundForStatementOperation(BoundForStatement boundForStatement)
         {
-            ImmutableArray<IOperation> before = ToStatements(boundForStatement.Initializer);
-            ImmutableArray<IOperation> atLoopBottom = ToStatements(boundForStatement.Increment);
+            Lazy<ImmutableArray<IOperation>> before = new Lazy<ImmutableArray<IOperation>>(() => ToStatements(boundForStatement.Initializer));
+            Lazy<ImmutableArray<IOperation>> atLoopBottom = new Lazy<ImmutableArray<IOperation>>(() => ToStatements(boundForStatement.Increment));
             ImmutableArray<ILocalSymbol> locals = boundForStatement.OuterLocals.As<ILocalSymbol>();
-            IOperation condition = boundForStatement.Condition;
+            Lazy<IOperation> condition = new Lazy<IOperation>(() => boundForStatement.Condition);
             LoopKind loopKind = LoopKind.For;
-            IOperation body = boundForStatement.Body;
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundForStatement.Body);
             bool isInvalid = boundForStatement.HasErrors;
             SyntaxNode syntax = boundForStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ForLoopStatement(before, atLoopBottom, locals, condition, loopKind, body, isInvalid, syntax, type, constantValue);
+            return new LazyForLoopStatement(before, atLoopBottom, locals, condition, loopKind, body, isInvalid, syntax, type, constantValue);
         }
         private static IForEachLoopStatement CreateBoundForEachStatementOperation(BoundForEachStatement boundForEachStatement)
         {
             ILocalSymbol iterationVariable = boundForEachStatement.IterationVariables.Length == 1 ?
                                                                                boundForEachStatement.IterationVariables.FirstOrDefault() :
                                                                                null;
-            IOperation collection = boundForEachStatement.Expression;
+            Lazy<IOperation> collection = new Lazy<IOperation>(() => boundForEachStatement.Expression);
             LoopKind loopKind = LoopKind.ForEach;
-            IOperation body = boundForEachStatement.Body;
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundForEachStatement.Body);
             bool isInvalid = boundForEachStatement.HasErrors;
             SyntaxNode syntax = boundForEachStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ForEachLoopStatement(iterationVariable, collection, loopKind, body, isInvalid, syntax, type, constantValue);
+            return new LazyForEachLoopStatement(iterationVariable, collection, loopKind, body, isInvalid, syntax, type, constantValue);
         }
         private static ISwitchStatement CreateBoundSwitchStatementOperation(BoundSwitchStatement boundSwitchStatement)
         {
-            IOperation value = boundSwitchStatement.Expression;
-            ImmutableArray<ISwitchCase> cases = ((ISwitchStatement)boundSwitchStatement).Cases /* MANUAL */;
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundSwitchStatement.Expression);
+            Lazy<ImmutableArray<ISwitchCase>> cases = new Lazy<ImmutableArray<ISwitchCase>>(() => ((ISwitchStatement)boundSwitchStatement).Cases /* MANUAL */);
             bool isInvalid = boundSwitchStatement.HasErrors;
             SyntaxNode syntax = boundSwitchStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new SwitchStatement(value, cases, isInvalid, syntax, type, constantValue);
+            return new LazySwitchStatement(value, cases, isInvalid, syntax, type, constantValue);
         }
         private static ISingleValueCaseClause CreateBoundSwitchLabelOperation(BoundSwitchLabel boundSwitchLabel)
         {
-            IOperation value = boundSwitchLabel.ExpressionOpt;
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundSwitchLabel.ExpressionOpt);
             BinaryOperationKind equality = ((ISingleValueCaseClause)boundSwitchLabel).Equality /* MANUAL */;
             CaseKind caseKind = boundSwitchLabel.ExpressionOpt != null ? CaseKind.SingleValue : CaseKind.Default;
             bool isInvalid = boundSwitchLabel.HasErrors;
             SyntaxNode syntax = boundSwitchLabel.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new SingleValueCaseClause(value, equality, caseKind, isInvalid, syntax, type, constantValue);
+            return new LazySingleValueCaseClause(value, equality, caseKind, isInvalid, syntax, type, constantValue);
         }
         private static ITryStatement CreateBoundTryStatementOperation(BoundTryStatement boundTryStatement)
         {
-            IBlockStatement body = boundTryStatement.TryBlock;
-            ImmutableArray<ICatchClause> catches = boundTryStatement.CatchBlocks.As<ICatchClause>();
-            IBlockStatement finallyHandler = boundTryStatement.FinallyBlockOpt;
+            Lazy<IBlockStatement> body = new Lazy<IBlockStatement>(() => boundTryStatement.TryBlock);
+            Lazy<ImmutableArray<ICatchClause>> catches = new Lazy<ImmutableArray<ICatchClause>>(() => boundTryStatement.CatchBlocks.As<ICatchClause>());
+            Lazy<IBlockStatement> finallyHandler = new Lazy<IBlockStatement>(() => boundTryStatement.FinallyBlockOpt);
             bool isInvalid = boundTryStatement.HasErrors;
             SyntaxNode syntax = boundTryStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new TryStatement(body, catches, finallyHandler, isInvalid, syntax, type, constantValue);
+            return new LazyTryStatement(body, catches, finallyHandler, isInvalid, syntax, type, constantValue);
         }
         private static ICatchClause CreateBoundCatchBlockOperation(BoundCatchBlock boundCatchBlock)
         {
-            IBlockStatement handler = boundCatchBlock.Body;
+            Lazy<IBlockStatement> handler = new Lazy<IBlockStatement>(() => boundCatchBlock.Body);
             ITypeSymbol caughtType = boundCatchBlock.ExceptionTypeOpt;
-            IOperation filter = boundCatchBlock.ExceptionFilterOpt;
+            Lazy<IOperation> filter = new Lazy<IOperation>(() => boundCatchBlock.ExceptionFilterOpt);
             ILocalSymbol exceptionLocal = ((ICatchClause)boundCatchBlock).ExceptionLocal /* MANUAL */;
             bool isInvalid = boundCatchBlock.Body.HasErrors || (boundCatchBlock.ExceptionFilterOpt != null && boundCatchBlock.ExceptionFilterOpt.HasErrors);
             SyntaxNode syntax = boundCatchBlock.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new CatchClause(handler, caughtType, filter, exceptionLocal, isInvalid, syntax, type, constantValue);
+            return new LazyCatchClause(handler, caughtType, filter, exceptionLocal, isInvalid, syntax, type, constantValue);
         }
         private static IFixedStatement CreateBoundFixedStatementOperation(BoundFixedStatement boundFixedStatement)
         {
-            IVariableDeclarationStatement variables = boundFixedStatement.Declarations;
-            IOperation body = boundFixedStatement.Body;
+            Lazy<IVariableDeclarationStatement> variables = new Lazy<IVariableDeclarationStatement>(() => boundFixedStatement.Declarations);
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundFixedStatement.Body);
             bool isInvalid = boundFixedStatement.HasErrors;
             SyntaxNode syntax = boundFixedStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new FixedStatement(variables, body, isInvalid, syntax, type, constantValue);
+            return new LazyFixedStatement(variables, body, isInvalid, syntax, type, constantValue);
         }
         private static IUsingStatement CreateBoundUsingStatementOperation(BoundUsingStatement boundUsingStatement)
         {
-            IOperation body = boundUsingStatement.Body;
-            IVariableDeclarationStatement declaration = boundUsingStatement.DeclarationsOpt;
-            IOperation value = boundUsingStatement.ExpressionOpt;
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundUsingStatement.Body);
+            Lazy<IVariableDeclarationStatement> declaration = new Lazy<IVariableDeclarationStatement>(() => boundUsingStatement.DeclarationsOpt);
+            Lazy<IOperation> value = new Lazy<IOperation>(() => boundUsingStatement.ExpressionOpt);
             bool isInvalid = boundUsingStatement.HasErrors;
             SyntaxNode syntax = boundUsingStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new UsingStatement(body, declaration, value, isInvalid, syntax, type, constantValue);
+            return new LazyUsingStatement(body, declaration, value, isInvalid, syntax, type, constantValue);
         }
         private static IThrowStatement CreateBoundThrowStatementOperation(BoundThrowStatement boundThrowStatement)
         {
-            IOperation thrownObject = boundThrowStatement.ExpressionOpt;
+            Lazy<IOperation> thrownObject = new Lazy<IOperation>(() => boundThrowStatement.ExpressionOpt);
             bool isInvalid = boundThrowStatement.HasErrors;
             SyntaxNode syntax = boundThrowStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ThrowStatement(thrownObject, isInvalid, syntax, type, constantValue);
+            return new LazyThrowStatement(thrownObject, isInvalid, syntax, type, constantValue);
         }
         private static IReturnStatement CreateBoundReturnStatementOperation(BoundReturnStatement boundReturnStatement)
         {
-            IOperation returnedValue = boundReturnStatement.ExpressionOpt;
+            Lazy<IOperation> returnedValue = new Lazy<IOperation>(() => boundReturnStatement.ExpressionOpt);
             bool isInvalid = boundReturnStatement.HasErrors;
             SyntaxNode syntax = boundReturnStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ReturnStatement(returnedValue, isInvalid, syntax, type, constantValue);
+            return new LazyReturnStatement(returnedValue, isInvalid, syntax, type, constantValue);
         }
         private static IReturnStatement CreateBoundYieldReturnStatementOperation(BoundYieldReturnStatement boundYieldReturnStatement)
         {
-            IOperation returnedValue = boundYieldReturnStatement.Expression;
+            Lazy<IOperation> returnedValue = new Lazy<IOperation>(() => boundYieldReturnStatement.Expression);
             bool isInvalid = boundYieldReturnStatement.HasErrors;
             SyntaxNode syntax = boundYieldReturnStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ReturnStatement(returnedValue, isInvalid, syntax, type, constantValue);
+            return new LazyReturnStatement(returnedValue, isInvalid, syntax, type, constantValue);
         }
         private static ILockStatement CreateBoundLockStatementOperation(BoundLockStatement boundLockStatement)
         {
-            IOperation lockedObject = boundLockStatement.Argument;
-            IOperation body = boundLockStatement.Body;
+            Lazy<IOperation> lockedObject = new Lazy<IOperation>(() => boundLockStatement.Argument);
+            Lazy<IOperation> body = new Lazy<IOperation>(() => boundLockStatement.Body);
             bool isInvalid = boundLockStatement.HasErrors;
             SyntaxNode syntax = boundLockStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new LockStatement(lockedObject, body, isInvalid, syntax, type, constantValue);
+            return new LazyLockStatement(lockedObject, body, isInvalid, syntax, type, constantValue);
         }
         private static IInvalidStatement CreateBoundBadStatementOperation(BoundBadStatement boundBadStatement)
         {
@@ -834,50 +835,50 @@
         }
         private static IVariableDeclarationStatement CreateBoundLocalDeclarationOperation(BoundLocalDeclaration boundLocalDeclaration)
         {
-            ImmutableArray<IVariableDeclaration> variables = ((IVariableDeclarationStatement)boundLocalDeclaration).Variables /* MANUAL */;
+            Lazy<ImmutableArray<IVariableDeclaration>> variables = new Lazy<ImmutableArray<IVariableDeclaration>>(() => ((IVariableDeclarationStatement)boundLocalDeclaration).Variables /* MANUAL */);
             bool isInvalid = boundLocalDeclaration.HasErrors;
             SyntaxNode syntax = boundLocalDeclaration.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new VariableDeclarationStatement(variables, isInvalid, syntax, type, constantValue);
+            return new LazyVariableDeclarationStatement(variables, isInvalid, syntax, type, constantValue);
         }
         private static IVariableDeclarationStatement CreateBoundMultipleLocalDeclarationsOperation(BoundMultipleLocalDeclarations boundMultipleLocalDeclarations)
         {
-            ImmutableArray<IVariableDeclaration> variables = ((IVariableDeclarationStatement)boundMultipleLocalDeclarations).Variables /* MANUAL */;
+            Lazy<ImmutableArray<IVariableDeclaration>> variables = new Lazy<ImmutableArray<IVariableDeclaration>>(() => ((IVariableDeclarationStatement)boundMultipleLocalDeclarations).Variables /* MANUAL */);
             bool isInvalid = boundMultipleLocalDeclarations.HasErrors;
             SyntaxNode syntax = boundMultipleLocalDeclarations.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new VariableDeclarationStatement(variables, isInvalid, syntax, type, constantValue);
+            return new LazyVariableDeclarationStatement(variables, isInvalid, syntax, type, constantValue);
         }
         private static ILabelStatement CreateBoundLabelStatementOperation(BoundLabelStatement boundLabelStatement)
         {
             ILabelSymbol label = boundLabelStatement.Label;
-            IOperation labeledStatement = null;
+            Lazy<IOperation> labeledStatement = new Lazy<IOperation>(() => null);
             bool isInvalid = boundLabelStatement.HasErrors;
             SyntaxNode syntax = boundLabelStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new LabelStatement(label, labeledStatement, isInvalid, syntax, type, constantValue);
+            return new LazyLabelStatement(label, labeledStatement, isInvalid, syntax, type, constantValue);
         }
         private static ILabelStatement CreateBoundLabeledStatementOperation(BoundLabeledStatement boundLabeledStatement)
         {
             ILabelSymbol label = boundLabeledStatement.Label;
-            IOperation labeledStatement = boundLabeledStatement.Body;
+            Lazy<IOperation> labeledStatement = new Lazy<IOperation>(() => boundLabeledStatement.Body);
             bool isInvalid = boundLabeledStatement.HasErrors;
             SyntaxNode syntax = boundLabeledStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new LabelStatement(label, labeledStatement, isInvalid, syntax, type, constantValue);
+            return new LazyLabelStatement(label, labeledStatement, isInvalid, syntax, type, constantValue);
         }
         private static IExpressionStatement CreateBoundExpressionStatementOperation(BoundExpressionStatement boundExpressionStatement)
         {
-            IOperation expression = boundExpressionStatement.Expression;
+            Lazy<IOperation> expression = new Lazy<IOperation>(() => boundExpressionStatement.Expression);
             bool isInvalid = boundExpressionStatement.HasErrors;
             SyntaxNode syntax = boundExpressionStatement.Syntax;
             ITypeSymbol type = null;
             Optional<object> constantValue = default(Optional<object>);
-            return new ExpressionStatement(expression, isInvalid, syntax, type, constantValue);
+            return new LazyExpressionStatement(expression, isInvalid, syntax, type, constantValue);
         }


Fixed a test

Fixed a test

--- src/Compilers/CSharp/Test/Symbol/Symbols/GenericConstraintTests.cs
+++ src/Compilers/CSharp/Test/Symbol/Symbols/GenericConstraintTests.cs
@@ -943,17 +943,23 @@
     event D<I<short>> E;
 }";
             CreateCompilation(source).VerifyDiagnostics(
-                // (5,9): error CS0452: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
-                Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "int").WithArguments("I<T>", "T", "int").WithLocation(5, 9),
                 // (8,23): error CS0452: The type 'short' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
+                //     event D<I<short>> E;
                 Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "E").WithArguments("I<T>", "T", "short").WithLocation(8, 23),
+                // (5,14): error CS0452: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
+                //     C(I<int> i) { }
+                Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "i").WithArguments("I<T>", "T", "int").WithLocation(5, 14),
                 // (6,13): error CS0452: The type 'byte' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
+                //     I<byte> P { get; set; }
                 Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "P").WithArguments("I<T>", "T", "byte").WithLocation(6, 13),
+                // (7,29): error CS0452: The type 'float' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
+                //     I<double> this[I<float> index] { get { return null; } }
+                Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "index").WithArguments("I<T>", "T", "float").WithLocation(7, 29),
                 // (7,15): error CS0452: The type 'double' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
+                //     I<double> this[I<float> index] { get { return null; } }
                 Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "this").WithArguments("I<T>", "T", "double").WithLocation(7, 15),
-                // (7,29): error CS0452: The type 'float' must be a reference type in order to use it as parameter 'T' in the generic type or method 'I<T>'
-                Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "index").WithArguments("I<T>", "T", "float").WithLocation(7, 29),
                 // (8,23): warning CS0067: The event 'C.E' is never used
+                //     event D<I<short>> E;
                 Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E").WithArguments("C.E").WithLocation(8, 23));
         }


Fix de lorsque l'on supprime un joueur, on enlève ce joueur dans la liste de joueurs de son équipe

--- Lama/UI/UC/Creation/ParticipantsView.xaml.cs
+++ Lama/UI/UC/Creation/ParticipantsView.xaml.cs
@@ -95,6 +95,7 @@
             // Supprimer l'objet Joueur
             foreach (Joueur j in LstJ)
             {
+                j.EquipeJoueur.LstJoueurs.Remove(j);
                 ((Tournoi)DataContext).LstJoueurs.Remove(j);
             }
         }


[Banshee.Metadata] Delay writing metadata for 2 seconds.

Gapless needs to update the LastPlayed field 1 sec before the track actually finishes
in order to make shuffle-by-* (and other queries which rely on LastPlayed) work.
This causes the metadata to be written out twice in quick succession.

Fix this by only writing the metadata of a track out if it has been unchanged in the
last 2 seconds.  This will have the effect of aggregating the metadata updates into
a single write.

--- src/Core/Banshee.Services/Banshee.Metadata/SaveTrackMetadataJob.cs
+++ src/Core/Banshee.Services/Banshee.Metadata/SaveTrackMetadataJob.cs
@@ -73,6 +73,12 @@
         {
             DatabaseTrackInfo track = DatabaseTrackInfo.Provider.Load (reader.Reader);

+            var write_delay = track.DateUpdated.AddSeconds (2) - DateTime.Now;
+            if (write_delay.TotalMilliseconds > 0) {
+                System.Threading.Thread.Sleep (write_delay);
+                return;
+            }
+
             bool wrote = false;
             bool renamed = false;
             try {


Initial implementation with event sourced projections

--- src/Elders.Cronus.Projections.Cassandra/Properties/AssemblyInfo.cs
+++ src/Elders.Cronus.Projections.Cassandra/Properties/AssemblyInfo.cs
@@ -9,10 +9,10 @@
 [assembly: AssemblyCopyrightAttribute("Copyright © 2016")]
 [assembly: AssemblyVersionAttribute("2.0.0.0")]
 [assembly: AssemblyFileVersionAttribute("2.0.0.0")]
-[assembly: AssemblyInformationalVersionAttribute("2.0.0-beta.1+2.Branch.release-2.0.0.Sha.0d75f641bd795a3a78426888c2f3856015d7c0af")]
+[assembly: AssemblyInformationalVersionAttribute("2.0.0-beta.1+3.Branch.release-2.0.0.Sha.5be7b4c16f655840a970d20b8029ffd24fb2848b")]
 namespace System {
     internal static class AssemblyVersionInformation {
         internal const string Version = "2.0.0.0";
-        internal const string InformationalVersion = "2.0.0-beta.1+2.Branch.release-2.0.0.Sha.0d75f641bd795a3a78426888c2f3856015d7c0af";
+        internal const string InformationalVersion = "2.0.0-beta.1+3.Branch.release-2.0.0.Sha.5be7b4c16f655840a970d20b8029ffd24fb2848b";
     }
 }


Remap diagnostics using IWorkspaceVenusSpanMappingService in-proc

Fixes #47214
Verified the issue repros prior to the fix and is resolved after this change.

--- src/Features/Core/Portable/Diagnostics/DocumentAnalysisExecutor.cs
+++ src/Features/Core/Portable/Diagnostics/DocumentAnalysisExecutor.cs
@@ -14,6 +14,7 @@
 using Microsoft.CodeAnalysis.ErrorReporting;
 using Microsoft.CodeAnalysis.Internal.Log;
 using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.PooledObjects;
 using Microsoft.CodeAnalysis.Shared.Extensions;
 using Microsoft.CodeAnalysis.Text;
 using Microsoft.CodeAnalysis.Workspaces.Diagnostics;
@@ -137,6 +138,9 @@
                 _ => throw ExceptionUtilities.UnexpectedValue(kind),
             };

+            // Remap diagnostic locations, if required.
+            diagnostics = await RemapDiagnosticLocationsIfRequiredAsync(textDocument, diagnostics, cancellationToken).ConfigureAwait(false);
+
 #if DEBUG
             var diags = await diagnostics.ToDiagnosticsAsync(textDocument.Project, cancellationToken).ConfigureAwait(false);
             Debug.Assert(diags.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diags, _compilationWithAnalyzers.Compilation).Count());
@@ -334,5 +338,33 @@
             }
 #endif
         }
+
+        private static async Task<ImmutableArray<DiagnosticData>> RemapDiagnosticLocationsIfRequiredAsync(
+            TextDocument textDocument,
+            ImmutableArray<DiagnosticData> diagnostics,
+            CancellationToken cancellationToken)
+        {
+            if (diagnostics.IsEmpty)
+            {
+                return diagnostics;
+            }
+
+            // Check if IWorkspaceVenusSpanMappingService is present for remapping.
+            var diagnosticSpanMappingService = textDocument.Project.Solution.Workspace.Services.GetService<IWorkspaceVenusSpanMappingService>();
+            if (diagnosticSpanMappingService == null)
+            {
+                return diagnostics;
+            }
+
+            // Round tripping the diagnostics should ensure they get correctly remapped.
+            using var _ = ArrayBuilder<DiagnosticData>.GetInstance(diagnostics.Length, out var builder);
+            foreach (var diagnosticData in diagnostics)
+            {
+                var diagnostic = await diagnosticData.ToDiagnosticAsync(textDocument.Project, cancellationToken).ConfigureAwait(false);
+                builder.Add(DiagnosticData.Create(diagnostic, textDocument));
+            }
+
+            return builder.ToImmutable();
+        }
     }
 }


added comma constant character

added comma constant character

--- src/Kingdom.OrTools.Sat.CodeGeneration.Core/Services/Characters.cs
+++ src/Kingdom.OrTools.Sat.CodeGeneration.Core/Services/Characters.cs
@@ -2,6 +2,11 @@
 {
     internal static class Characters
     {
+        /// <summary>
+        /// ','
+        /// </summary>
+        public const char Comma = ',';
+
         /// <summary>
         /// '.'
         /// </summary>


less allocatey logging for trigger details (#2505)

--- src/Microsoft.Azure.WebJobs.Host/Loggers/FunctionInstanceLogger.cs
+++ src/Microsoft.Azure.WebJobs.Host/Loggers/FunctionInstanceLogger.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Linq;
+using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
 using Microsoft.Azure.WebJobs.Host.Protocols;
@@ -37,12 +38,23 @@
             return Task.FromResult<string>(null);
         }

-        private void LogTemplatizedTriggerDetails(ILogger logger, FunctionStartedMessage message)
+        private static void LogTemplatizedTriggerDetails(ILogger logger, FunctionStartedMessage message)
         {
-            var templateKeys = message.TriggerDetails.Select(entry => $"{entry.Key}: {{{entry.Key}}}");
-            string messageTemplate = "Trigger Details: " + string.Join(", ", templateKeys);
-            string[] templateValues = message.TriggerDetails.Values.ToArray();
+            var sb = new StringBuilder("Trigger Details: ");

+            foreach (var entry in message.TriggerDetails)
+            {
+                sb.Append(entry.Key);
+                sb.Append(": {");
+                sb.Append(entry.Key);
+                sb.Append("}, ");
+            }
+
+            // remove last 2 chars, which are ", "
+            sb.Remove(sb.Length - 2, 2);
+            var messageTemplate = sb.ToString();
+
+            var templateValues = message.TriggerDetails.Values.ToArray();
             logger.LogInformation(messageTemplate, templateValues);
         }


Added an additional unit test

Added an additional unit test

--- src/NUnitFramework/tests/Constraints/NUnitEqualityComparerTests.cs
+++ src/NUnitFramework/tests/Constraints/NUnitEqualityComparerTests.cs
@@ -200,6 +200,23 @@
             Assert.That(n.AreEqual(obj1, obj2, ref tolerance), Is.True);
             Assert.That(n.AreEqual(obj2, obj1, ref tolerance), Is.True);
         }
+
+        [Test]
+        public void CanHandleMultipleImplementationsOfIEquatable()
+        {
+            IEquatableObject obj1 = new InheritedEquatableObject { SomeProperty = 1 };
+            IEquatableObject obj2 = new MultipleIEquatables { SomeProperty = 1 };
+            var obj3 = new EquatableObject { SomeProperty = 1 };
+
+            var n = new NUnitEqualityComparer();
+            var tolerance = Tolerance.Exact;
+            Assert.That(n.AreEqual(obj1, obj2, ref tolerance), Is.True);
+            Assert.That(n.AreEqual(obj2, obj1, ref tolerance), Is.True);
+            Assert.That(n.AreEqual(obj1, obj3, ref tolerance), Is.False);
+            Assert.That(n.AreEqual(obj3, obj1, ref tolerance), Is.False);
+            Assert.That(n.AreEqual(obj2, obj3, ref tolerance), Is.True);
+            Assert.That(n.AreEqual(obj3, obj2, ref tolerance), Is.True);
+        }
     }

     public class NeverEqualIEquatableWithOverriddenAlwaysTrueEquals : IEquatable<NeverEqualIEquatableWithOverriddenAlwaysTrueEquals>
@@ -288,4 +305,14 @@
         }
     }

+    public class MultipleIEquatables : InheritedEquatableObject, IEquatable<EquatableObject>
+    {
+        public bool Equals(EquatableObject other)
+        {
+            if (other == null)
+                return false;
+
+            return SomeProperty == other.SomeProperty;
+        }
+    }
 }


Another attempt to fix the annoying datetime test

--- src/Nancy.Tests/Unit/Routing/ConstraintNodeRouteResolverFixture.cs
+++ src/Nancy.Tests/Unit/Routing/ConstraintNodeRouteResolverFixture.cs
@@ -99,10 +99,10 @@
         public void Should_resolve_datetime_constraint()
         {
             var dateTime = new DateTime(2010, 1, 2, 3, 4, 5, 6);
-            var urlEncodeDateTime = HttpUtility.UrlEncode(dateTime.ToString("dd MM yyyy hh:mm:ss.f", CultureInfo.InvariantCulture));
+            var urlEncodeDateTime = HttpUtility.UrlEncode(dateTime.ToString("yyyy-MM-dd hh:mm:ss", CultureInfo.InvariantCulture));
             var result = this.browser.Get("/datetimeConstraint/" + urlEncodeDateTime);

-            result.Body.AsString().ShouldEqual("02-01-2010 03:04:05");
+            result.Body.AsString().ShouldEqual("2010-01-02 03:04:05");
         }

         [Fact]
@@ -287,7 +287,7 @@

                 Get["/alphaConstraint/{value:alpha}"] = _ => "AlphaConstraint";

-                Get["/datetimeConstraint/{value:datetime}"] = _ => DateTime.Parse(_.value).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
+                Get["/datetimeConstraint/{value:datetime}"] = _ => DateTime.Parse(_.value).ToString("yyyy-MM-dd hh:mm:ss", CultureInfo.InvariantCulture);

                 Get["/minConstraint/{value:min(4)}"] = _ => "MinConstraint";


updated attributes on controller actions

--- src/Esfa.Vacancy.Register.Api/Controllers/SearchApprenticeshipVacanciesController.cs
+++ src/Esfa.Vacancy.Register.Api/Controllers/SearchApprenticeshipVacanciesController.cs
@@ -7,6 +7,7 @@

 namespace Esfa.Vacancy.Register.Api.Controllers
 {
+    [RoutePrefix("api/v1/apprenticeships")]
     public class SearchApprenticeshipVacanciesController : ApiController
     {
         private readonly SearchApprenticeshipVacanciesOrchestrator _searchOrchestrator;
@@ -21,14 +22,12 @@
         /// from the Recruit an apprentice system. This service allows various parameters to allow the system
         /// integrators to select the most relevant apprenticeships and/or request up-to date details after a given date.
         /// </summary>
-        /// <param name="searchApprenticeshipParameters">The search apprenticeship parameters.</param>
-        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        [Route("search")]
         [SwaggerOperation("SearchApprenticeshipVacancies", Tags = new[] { "Apprenticeships" })]
         [SwaggerResponse(HttpStatusCode.OK, "OK", typeof(ApprenticeshipSummary))]
-        [SwaggerResponse(HttpStatusCode.NotFound)]
-        [Route("api/v1/apprenticeships/search")]
-        [HttpGet]
-        [AllowAnonymous]
+        [SwaggerResponse(HttpStatusCode.BadRequest, "Failed request validation", typeof(BadRequestError))]
         public async Task<IHttpActionResult> Search([FromUri]SearchApprenticeshipParameters searchApprenticeshipParameters)
         {
             var results = await _searchOrchestrator.SearchApprenticeship(searchApprenticeshipParameters);


Fix removing directives

Fix removing directives

--- src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
+++ src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
@@ -185,15 +185,15 @@
                 }
             }

-            const SyntaxRemoveOptions options = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker;
+            var syntaxRemoveOptions = SyntaxGenerator.DefaultRemoveOptions;
             if (fieldDocument == propertyDocument)
             {
                 // Same file.  Have to do this in a slightly complicated fashion.
                 var declaratorTreeRoot = await fieldDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

                 var editor = new SyntaxEditor(declaratorTreeRoot, fieldDocument.Project.Solution.Workspace);
-                editor.RemoveNode(nodeToRemove, options);
                 editor.ReplaceNode(property, updatedProperty);
+                editor.RemoveNode(nodeToRemove, syntaxRemoveOptions);

                 var newRoot = editor.GetChangedRoot();
                 newRoot = await FormatAsync(newRoot, fieldDocument, cancellationToken).ConfigureAwait(false);
@@ -206,7 +206,7 @@
                 var fieldTreeRoot = await fieldDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
                 var propertyTreeRoot = await propertyDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

-                var newFieldTreeRoot = fieldTreeRoot.RemoveNode(nodeToRemove, options);
+                var newFieldTreeRoot = fieldTreeRoot.RemoveNode(nodeToRemove, syntaxRemoveOptions);
                 var newPropertyTreeRoot = propertyTreeRoot.ReplaceNode(property, updatedProperty);

                 newFieldTreeRoot = await FormatAsync(newFieldTreeRoot, fieldDocument, cancellationToken).ConfigureAwait(false);


Need to make sure that we don't have setters on proxies

--- src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs
+++ src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs
@@ -2,8 +2,8 @@
 {
     public interface IViewComponentDescriptor
     {
-        string Id { get; set; }
-        string FullName { get; set; }
-        string ShortName { get; set; }
+        string Id { get; }
+        string FullName { get; }
+        string ShortName { get; }
     }
 }


Added WeatherStates message identifier

Added WeatherStates message identifier

--- Loxone.Client/Transport/MessageIdentifier.cs
+++ Loxone.Client/Transport/MessageIdentifier.cs
@@ -18,6 +18,7 @@
         TextStates = 3,
         DayTimerStates = 4,
         OutOfService = 5,
-        KeepAlive = 6
+        KeepAlive = 6,
+        WeatherStates = 7
     }
 }


test for it

test for it

--- Manager/ManagerTest/ManagerOperationsTest.cs
+++ Manager/ManagerTest/ManagerOperationsTest.cs
@@ -59,6 +59,15 @@
 		}

 		[Test]
+		public void ShouldNotSendJobWhenNoJobsInQueue()
+		{
+			NodeRepository.AddWorkerNode(_workerNode);
+			HttpSender.CallToWorkerNodes.Clear();
+			JobRepository.AssignJobToWorkerNode();
+			HttpSender.CallToWorkerNodes.Count.Should().Be.EqualTo(0);
+		}
+
+		[Test]
 		public void ShouldBeAbleToPersistNewJobQueueItem()
 		{
 			var jobQueueItem = new JobQueueItem


Document and improve `FetchStackFramesAsync`

--- src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs
+++ src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs
@@ -668,6 +668,11 @@
             }
             catch (CmdletInvocationException ex)
             {
+                // It's possible to be asked to run `Get-Variable -Scope N` where N is a number that
+                // exceeds the available scopes. In this case, the command throws this exception,
+                // but there's nothing we can do about it, nor can we know the number of scopes that
+                // exist, and we shouldn't crash the debugger, so we just return no results instead.
+                // All other exceptions should be thrown again.
                 if (!ex.ErrorRecord.CategoryInfo.Reason.Equals("PSArgumentOutOfRangeException"))
                 {
                     throw;
@@ -757,6 +762,8 @@
             if (((variableScope & constantAllScope) == constantAllScope)
                 || ((variableScope & readonlyAllScope) == readonlyAllScope))
             {
+                // The constructor we are using here does not automatically add the dollar prefix,
+                // so we do it manually.
                 string prefixedVariableName = VariableDetails.DollarPrefix + variableName;
                 if (globalScopeVariables.Children.ContainsKey(prefixedVariableName))
                 {
@@ -769,30 +776,27 @@

         private async Task FetchStackFramesAsync(string scriptNameOverride)
         {
-            PSCommand psCommand = new PSCommand();
-            // The serialization depth to retrieve variables from remote runspaces.
-            const int serializationDepth = 3;
-
             // This glorious hack ensures that Get-PSCallStack returns a list of CallStackFrame
             // objects (or "deserialized" CallStackFrames) when attached to a runspace in another
-            // process.  Without the intermediate variable Get-PSCallStack inexplicably returns
-            // an array of strings containing the formatted output of the CallStackFrame list.
-            string callStackVarName = $"$global:{PsesGlobalVariableNamePrefix}CallStack";
-
-            string getPSCallStack = $"Get-PSCallStack | ForEach-Object {{ [void]{callStackVarName}.add(@($PSItem,$PSItem.GetFrameVariables())) }}";
-
-            // If we're attached to a remote runspace, we need to serialize the callstack prior to transport
-            // because the default depth is too shallow
+            // process. Without the intermediate variable Get-PSCallStack inexplicably returns an
+            // array of strings containing the formatted output of the CallStackFrame list. So we
+            // run a script that builds the list of CallStackFrames and their variables.
+            const string callStackVarName = $"$global:{PsesGlobalVariableNamePrefix}CallStack";
+            const string getPSCallStack = $"Get-PSCallStack | ForEach-Object {{ [void]{callStackVarName}.Add(@($PSItem, $PSItem.GetFrameVariables())) }}";
+
+            // If we're attached to a remote runspace, we need to serialize the list prior to
+            // transport because the default depth is too shallow. From testing, we determined the
+            // correct depth is 3. The script always calls `Get-PSCallStack`. On a local machine, we
+            // just return its results. On a remote machine we serialize it first and then later
+            // deserialize it.
             bool isOnRemoteMachine = _psesHost.CurrentRunspace.IsOnRemoteMachine;
             string returnSerializedIfOnRemoteMachine = isOnRemoteMachine
-                ? $"[Management.Automation.PSSerializer]::Serialize({callStackVarName}, {serializationDepth})"
+                ? $"[Management.Automation.PSSerializer]::Serialize({callStackVarName}, 3)"
                 : callStackVarName;

-            // We have to deal with a shallow serialization depth with ExecutePSCommandAsync as well, hence the serializer to get full var information
-            psCommand.AddScript($"[Collections.ArrayList]{callStackVarName} = @(); {getPSCallStack}; {returnSerializedIfOnRemoteMachine}");
-
-
-            // PSObject is used here instead of the specific type because we get deserialized objects from remote sessions and want a common interface
+            // PSObject is used here instead of the specific type because we get deserialized
+            // objects from remote sessions and want a common interface.
+            var psCommand = new PSCommand().AddScript($"[Collections.ArrayList]{callStackVarName} = @(); {getPSCallStack}; {returnSerializedIfOnRemoteMachine}");
             IReadOnlyList<PSObject> results = await _executionService.ExecutePSCommandAsync<PSObject>(psCommand, CancellationToken.None).ConfigureAwait(false);

             IEnumerable callStack = isOnRemoteMachine
@@ -816,11 +820,13 @@

                 foreach (DictionaryEntry entry in callStackVariables)
                 {
-                    // TODO: This should be deduplicated into a new function for the other variable handling as well
+                    // TODO: This should be deduplicated into a new function.
                     object psVarValue = isOnRemoteMachine
                         ? (entry.Value as PSObject).Properties["Value"].Value
                         : (entry.Value as PSVariable).Value;
-                    // The constructor we are using here does not automatically add the dollar prefix
+
+                    // The constructor we are using here does not automatically add the dollar
+                    // prefix, so we do it manually.
                     string psVarName = VariableDetails.DollarPrefix + entry.Key.ToString();
                     var variableDetails = new VariableDetails(psVarName, psVarValue) { Id = nextVariableId++ };
                     variables.Add(variableDetails);


Missed a new array to resize

Missed a new array to resize

--- patches/tModLoader/Terraria.ModLoader/ItemLoader.cs
+++ patches/tModLoader/Terraria.ModLoader/ItemLoader.cs
@@ -137,6 +137,7 @@
 			Array.Resize(ref Main.itemFlameLoaded, nextItem);
 			Array.Resize(ref Main.itemFlameTexture, nextItem);
 			Array.Resize(ref Main.itemAnimations, nextItem);
+			Array.Resize(ref Item.itemCaches, nextItem);
 			Array.Resize(ref Item.staff, nextItem);
 			Array.Resize(ref Item.claw, nextItem);
 			//Array.Resize(ref ItemID.Sets.TextureCopyLoad, nextItem); //not needed?
@@ -169,6 +170,7 @@
 			Array.Resize(ref ItemID.Sets.SingleUseInGamepad, nextItem);
 			for (int k = ItemID.Count; k < nextItem; k++)
 			{
+				Item.itemCaches[k] = -1;
 				//ItemID.Sets.TextureCopyLoad[k] = -1;
 				ItemID.Sets.ExtractinatorMode[k] = -1;
 				ItemID.Sets.StaffMinionSlotsRequired[k] = 1;


overwrite installtion files if user approves

--- src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml.cs
+++ src/SIM.Tool.Windows/UserControls/Install/Instance9Details.xaml.cs
@@ -120,6 +120,11 @@
         {
           return false;
         }
+        else
+        {
+          Directory.Delete(args.ScriptRoot, true);
+          Directory.CreateDirectory(args.ScriptRoot);
+        }
       }

       RealZipFile zip = new RealZipFile(new RealFile(new RealFileSystem(), args.Product.PackagePath));


Added missing compile directive.

Added missing compile directive.

--- Mindscape.Raygun4Net/RaygunMessageBuilder.cs
+++ Mindscape.Raygun4Net/RaygunMessageBuilder.cs
@@ -78,11 +78,13 @@
         _raygunMessage.Details.Error = new RaygunErrorMessage(exception);
       }

+#if !WINRT && !WINDOWS_PHONE && !ANDROID && !IOS
       HttpException error = exception as HttpException;
       if (error != null)
       {
         _raygunMessage.Details.Response = new RaygunResponseMessage() { StatusCode = error.GetHttpCode() };
       }
+#endif

       return this;
     }


MR Plugin: Fixed not handled ClientActions when sent to pits

--- MinoRatingPlugin/MinoRatingPlugin/Program.cs
+++ MinoRatingPlugin/MinoRatingPlugin/Program.cs
@@ -380,7 +380,7 @@
                     // This will invalidate the current lap,
                     _consistencyReports[di] = null;
                     // but we need to tell MR
-                    LiveDataServer.DriverBackToPits(CurrentSessionGuid, di.LastCarUpdate.Value.CreationDate, di.CarId);
+                    HandleClientActions(LiveDataServer.DriverBackToPits(CurrentSessionGuid, di.LastCarUpdate.Value.CreationDate, di.CarId));
                 }

             if (di.LastCarUpdate.List.Count > 1 && _consistencyReports[di] == null)


217: TextBreakEngine, rename var

217: TextBreakEngine, rename var

--- src/PixelFarm/Typography/Typography.TextBreak/Typography.TextBreak/BreakingEngine.cs
+++ src/PixelFarm/Typography/Typography.TextBreak/Typography.TextBreak/BreakingEngine.cs
@@ -49,7 +49,7 @@
             char c_last = this.LastUnicodeChar;
             int endAt = startAt + len;

-            Stack<int> candidate = visitor.GetTempCandidateBreaks();
+            Stack<int> candidates = visitor.GetTempCandidateBreaks();

             for (int i = startAt; i < endAt;)
             {
@@ -83,13 +83,13 @@
                     }
                     //---------------------
                     WordGroup c_wordgroup = wordgroup;
-                    candidate.Clear();
+                    candidates.Clear();

                     int candidateLen = 1;

                     if (c_wordgroup.PrefixIsWord)
                     {
-                        candidate.Push(candidateLen);
+                        candidates.Push(candidateLen);
                     }

                     bool continueRead = true;
@@ -112,7 +112,7 @@
                                 //accept
                                 if (next1.PrefixIsWord)
                                 {
-                                    candidate.Push(candidateLen);
+                                    candidates.Push(candidateLen);
                                 }
                             }
                             else
@@ -126,7 +126,7 @@
                                     {
                                         visitor.AddWordBreakAt(p2);
                                         visitor.SetCurrentIndex(p2);
-                                        candidate.Clear();
+                                        candidates.Clear();
                                     }
                                 }
                             }
@@ -134,10 +134,10 @@
                             i = endAt; //temp fix, TODO: review here

                             //choose best match
-                            if (candidate.Count > 0)
-                            {
-
-                                int candi1 = candidate.Pop();
+                            if (candidates.Count > 0)
+                            {
+
+                                int candi1 = candidates.Pop();
                                 //try
                                 visitor.SetCurrentIndex(visitor.LatestBreakAt + candi1);
                                 //use this
@@ -157,7 +157,7 @@

                             if (next.PrefixIsWord)
                             {
-                                candidate.Push(candidateLen);
+                                candidates.Push(candidateLen);
                             }
                             c_wordgroup = next;
                             i = visitor.CurrentIndex;
@@ -167,10 +167,9 @@
                                 i = endAt; //temp fix, TODO: review here
                                 bool foundCandidate = false;
                                 //choose best match
-                                while (candidate.Count > 0)
-                                {
-
-                                    int candi1 = candidate.Pop();
+                                while (candidates.Count > 0)
+                                {
+                                    int candi1 = candidates.Pop();
                                     //try
                                     visitor.SetCurrentIndex(visitor.LatestBreakAt + candi1);
                                     if (visitor.State != VisitorState.End)
@@ -221,8 +220,8 @@
                                     else
                                     {
                                         bool foundCandidate = false;
-                                        int candi_count = candidate.Count;
-                                        if (candi_count == 0)
+
+                                        if (candidates.Count == 0)
                                         {
                                             //no candidate
                                             //need to step back
@@ -258,11 +257,9 @@
                                         }
                                         else
                                         {
-                                            while (candi_count > 0)
+                                            while (candidates.Count > 0)
                                             {
-                                                int candi1 = candidate.Pop();
-                                                candi_count--;
-
+                                                int candi1 = candidates.Pop();
                                                 //try
                                                 visitor.SetCurrentIndex(visitor.LatestBreakAt + candi1);
                                                 //check if we can use this candidate
@@ -313,10 +310,10 @@
                             {

                                 bool foundCandidate = false;
-                                while (candidate.Count > 0)
-                                {
-
-                                    int candi1 = candidate.Pop();
+                                while (candidates.Count > 0)
+                                {
+
+                                    int candi1 = candidates.Pop();
                                     //try
                                     visitor.SetCurrentIndex(visitor.LatestBreakAt + candi1);
                                     if (visitor.State == VisitorState.End)


Hiding Approve option when cohort is incomplete

--- src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Commitment/FinishEditing.cshtml
+++ src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Commitment/FinishEditing.cshtml
@@ -32,19 +32,22 @@

                         @Html.ValidationMessageFor(m => m.SaveStatus, "Please choose an option", new { id = "error-message-" + Html.IdFor(m => m.SaveStatus) })

-                    @if (Model.IsApproveAndSend)
+                    @if (!Model.NotReadyForApproval)
                     {
-
-                            @Html.RadioButtonFor(m => m.SaveStatus, SaveStatus.ApproveAndSend, GetRadioButtonAttributes(SaveStatus.ApproveAndSend, Model.NotReadyForApproval))
-                            Approve and send to employer for approval
-
-                    }
-                    else
-                    {
-
-                            @Html.RadioButtonFor(m => m.SaveStatus, SaveStatus.Approve, GetRadioButtonAttributes(SaveStatus.Approve, Model.NotReadyForApproval))
-                            Approve
-
+                        if (Model.IsApproveAndSend)
+                        {
+
+                                @Html.RadioButtonFor(m => m.SaveStatus, SaveStatus.ApproveAndSend, GetRadioButtonAttributes(SaveStatus.ApproveAndSend, Model.NotReadyForApproval))
+                                Approve and send to employer for approval
+
+                        }
+                        else
+                        {
+
+                                @Html.RadioButtonFor(m => m.SaveStatus, SaveStatus.Approve, GetRadioButtonAttributes(SaveStatus.Approve, Model.NotReadyForApproval))
+                                Approve
+
+                        }
                     }

@@ -98,13 +101,13 @@
     public string GetInvalidStateForApprovalMessage(bool hasApprenticeships, int invalidApprentieshipCount)
     {
         if (!hasApprenticeships)
-            return "You need to add details for at least one apprentice - " + Html.ActionLink("add an apprentice", "Details", new { hashedAccountId = Model.ProviderId, hashedCommitmentId = Model.HashedCommitmentId });
+            return "You need to add details for at least one apprentice before you can approve this cohort - " + Html.ActionLink("add an apprentice", "Details", new { hashedAccountId = Model.ProviderId, hashedCommitmentId = Model.HashedCommitmentId });

         var emptyLink = Html.ActionLink("go back and add details", "Details", new { hashedAccountId = Model.ProviderId, hashedCommitmentId = Model.HashedCommitmentId });

         return invalidApprentieshipCount == 1
-            ? "You have 1 apprentice with incomplete details - " + emptyLink
-            : $"You have {invalidApprentieshipCount} apprentices with incomplete details - " + emptyLink;
+            ? "You have 1 apprentice with incomplete details. All apprentice details must be complete before you can approve this cohort - " + emptyLink
+            : $"You have {invalidApprentieshipCount} apprentices with incomplete details. All apprentice details must be complete before you can approve this cohort - " + emptyLink;
     }
 }


Disable another test

Disable another test

Ref #13188

--- src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs
+++ src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs
@@ -1746,6 +1746,7 @@
         #endregion

         #region Proxy tests
+        [ActiveIssue(13188)]
         [OuterLoop] // TODO: Issue #11345
         [Theory]
         [MemberData(nameof(CredentialsForProxy))]


started to clean up RestSharp code

started to clean up RestSharp code

--- NewRelicAPIPoshProvider/Paths/Application.cs
+++ NewRelicAPIPoshProvider/Paths/Application.cs
@@ -18,7 +18,7 @@
 {
     class ApplicationsPathNode : PathNodeBase
     {
-        private const string _applications = "https://api.newrelic.com/v2/applications.json";
+        private const string _applications = "https://api.newrelic.com";

         public ApplicationsPathNode()
         {
@@ -38,7 +38,9 @@
         {
             var client = new RestClient(_applications);

-            var request = new RestRequest(Method.GET);
+            var request = new RestRequest();
+            request.Resource = "/v2/applications.json";
+            request.AddHeader("Accept", "application/json");
             request.AddHeader("X-Api-Key", providerContext.Drive.Credential.UserName);

             IRestResponse response = client.Execute(request);
@@ -58,7 +60,7 @@
     class ApplicationPathNode : PathNodeBase
     {
         private readonly Application _application;
-        private const string _metricNamesEndPoint = "https://api.newrelic.com/v2/applications/{0}/metrics.json";
+        private const string _metricNamesEndPoint = "https://api.newrelic.com";

         public ApplicationPathNode(Application application)
         {
@@ -77,10 +79,13 @@

         public override IEnumerable<IPathNode> GetNodeChildren(CodeOwls.PowerShell.Provider.PathNodeProcessors.IProviderContext providerContext)
         {
-            var client = new RestClient(string.Format(_metricNamesEndPoint, _application.Id));
+            var client = new RestClient(_metricNamesEndPoint);

-            var request = new RestRequest(Method.GET);
+            var request = new RestRequest();
+            request.Resource = "/v2/applications/{applicationId}/metrics.json";
+            request.AddHeader("Accept", "application/json");
             request.AddHeader("X-Api-Key", providerContext.Drive.Credential.UserName);
+            request.AddParameter("applicationId", _application.Id, ParameterType.UrlSegment);

             IRestResponse response = client.Execute(request);