/// <summary>Creates an exception to be used when CheckCompatibleAssignment fails.</summary>
        /// <param name="targetType">Type being initialized.</param>
        /// <param name="previous">Previously seen member accesses.</param>
        /// <param name="candidate">Member assignments under evaluate.</param>
        /// <returns>A new exception with diagnostic information.</returns>
        private static Exception CheckCompatibleAssignmentsFail(Type targetType, Expression[] previous, Expression[] candidate)
        {
            Debug.Assert(targetType != null, "targetType != null");
            Debug.Assert(previous != null, "previous != null");
            Debug.Assert(candidate != null, "candidate != null");

            string message = Strings.ALinq_ProjectionMemberAssignmentMismatch(targetType.FullName, previous.LastOrDefault(), candidate.LastOrDefault());

            return(new NotSupportedException(message));
        }