Click here to Skip to main content
15,916,042 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Big bad bug in .NET... Pin
Kevin Marois1-Dec-16 6:30
professionalKevin Marois1-Dec-16 6:30 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 8:09
professionalSander Rossel1-Dec-16 8:09 
GeneralRe: Big bad bug in .NET... Pin
#realJSOP1-Dec-16 6:37
professional#realJSOP1-Dec-16 6:37 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 8:11
professionalSander Rossel1-Dec-16 8:11 
GeneralRe: Big bad bug in .NET... Pin
Richard Deeming1-Dec-16 11:13
mveRichard Deeming1-Dec-16 11:13 
GeneralRe: Big bad bug in .NET... Pin
Matt T Heffron2-Dec-16 12:11
professionalMatt T Heffron2-Dec-16 12:11 
GeneralRe: Big bad bug in .NET... Pin
OriginalGriff1-Dec-16 8:33
mveOriginalGriff1-Dec-16 8:33 
GeneralRe: Big bad bug in .NET... Pin
Jon McKee1-Dec-16 9:45
professionalJon McKee1-Dec-16 9:45 
Hmm, I've maybe had to use named parameters a handful of times but never had any issues. Possibly stupid question but have you ensured the ordering is correct? Named parameters are evaluated in order passed not by the ordering in the function passed-to. This may not be applicable but I never assume people's objects (Input in this case) are side-effect free.

Example:
C#
static void Main(string[] args)
{
    int num = 0;
    Test(z: ++num, y: ++num, x: ++num);
    Console.ReadKey();
}

public static void Test(int x, int y, int z)
{
    Console.WriteLine($"X: {x}, Y: {y}, Z: {z}");
}
//Output: X: 3, Y: 2, Z: 1

This is a pretty contrived example, but I can't reproduce with this, no matter how I arrange the named input:
C#
static void Main(string[] args)
{
    int x = 1, y = 2, z;
    List<int> values = new List<int>() { 3, 4, 5, 6 };
    IEnumerable<int> query1 = values.Where(num => num % 2 == 0);
    IEnumerable<int> query2 = values.Where(num => num % 2 != 0);
    Test(y: y, x: x, query2: query2, query1: query1, z: out z);
    Console.WriteLine($"Z: {z}");
    Console.ReadKey();
}

public static void Test(int x, int y, IEnumerable<int> query1, IEnumerable<int> query2, out int z)
{
    Console.WriteLine("Inside Test:");
    Console.WriteLine($"X: {x}, Y: {y}");
    Console.Write("Even: ");
    foreach (int val in query1)
        Console.Write($"{val} ");
    Console.Write("\nOdd: ");
    foreach (int val in query2)
        Console.Write($"{val} ");
    Console.Write("\n");
    z = 7;
}

GeneralRe: Big bad bug in .NET... Pin
dandy721-Dec-16 11:00
dandy721-Dec-16 11:00 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 21:16
professionalSander Rossel1-Dec-16 21:16 
GeneralRe: Big bad bug in .NET... Pin
dandy722-Dec-16 3:40
dandy722-Dec-16 3:40 
GeneralRe: Big bad bug in .NET... Pin
Richard Deeming1-Dec-16 11:22
mveRichard Deeming1-Dec-16 11:22 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 21:11
professionalSander Rossel1-Dec-16 21:11 
GeneralThought of the day Pin
OriginalGriff1-Dec-16 4:51
mveOriginalGriff1-Dec-16 4:51 
GeneralRe: Thought of the day Pin
lopatir1-Dec-16 4:56
lopatir1-Dec-16 4:56 
GeneralRe: Thought of the day Pin
Richard Deeming1-Dec-16 4:58
mveRichard Deeming1-Dec-16 4:58 
GeneralRe: Thought of the day Pin
W Balboos, GHB1-Dec-16 5:02
W Balboos, GHB1-Dec-16 5:02 
GeneralRe: Thought of the day Pin
Daniel Pfeffer1-Dec-16 5:07
professionalDaniel Pfeffer1-Dec-16 5:07 
GeneralRe: Thought of the day Pin
den2k881-Dec-16 5:18
professionalden2k881-Dec-16 5:18 
GeneralRe: Thought of the day Pin
Joe Woodbury1-Dec-16 5:26
professionalJoe Woodbury1-Dec-16 5:26 
GeneralRe: Thought of the day Pin
lopatir1-Dec-16 5:30
lopatir1-Dec-16 5:30 
GeneralRe: Thought of the day Pin
Joe Woodbury1-Dec-16 5:32
professionalJoe Woodbury1-Dec-16 5:32 
GeneralRe: Thought of the day Pin
OriginalGriff1-Dec-16 5:49
mveOriginalGriff1-Dec-16 5:49 
GeneralRe: Thought of the day Pin
Joe Woodbury1-Dec-16 6:02
professionalJoe Woodbury1-Dec-16 6:02 
GeneralAPOD Pin
R. Giskard Reventlov1-Dec-16 4:47
R. Giskard Reventlov1-Dec-16 4:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.