Click here to Skip to main content
15,905,028 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: Dear alcohol Pin
Kevin Marois1-Dec-16 7:22
professionalKevin Marois1-Dec-16 7:22 
GeneralRe: Dear alcohol Pin
Mike Hankey1-Dec-16 7:24
mveMike Hankey1-Dec-16 7:24 
GeneralRe: Dear alcohol Pin
Slacker0071-Dec-16 8:36
professionalSlacker0071-Dec-16 8:36 
GeneralRe: Dear alcohol Pin
parths1-Dec-16 18:24
parths1-Dec-16 18:24 
GeneralRe: Dear alcohol Pin
Mycroft Holmes1-Dec-16 19:09
professionalMycroft Holmes1-Dec-16 19:09 
GeneralRe: Dear alcohol Pin
Mark_Wallace1-Dec-16 9:57
Mark_Wallace1-Dec-16 9:57 
JokeDear Mr Hankey Pin
Rajesh R Subramanian1-Dec-16 14:27
professionalRajesh R Subramanian1-Dec-16 14:27 
GeneralBig bad bug in .NET... Pin
Sander Rossel1-Dec-16 6:17
professionalSander Rossel1-Dec-16 6:17 
So a coworker just called me and was "you have got to see this!"
Basically, he just invoked a method with some named parameters (of which two were unevaluated LINQ expressions) and the invoked method receives the parameters in the wrong order.
Parameter a gets expression b while parameter b gets expression a.
We tried evaluation the LINQ expressions first, but the result was the same.
Then we removed the names from the parameters and everything worked fine.
We also tried to make the parameters named and go down a .NET version (to 4.5.2), but the problem still persisted.
We checked the intermediate language and, indeed, the variables were loaded onto the stack in the wrong order.
What the... WTF | :WTF:

Moral of the story, don't use named parameters as they are bugged Unsure | :~

Example:
Just a regular method call, be it a bloated one.
C#
public SomeClass SomeFunction(Input input)
{
   SomeType outA;
   AnotherType outB;
   ThirdType outC;
   return somefield.DoSomething(
      name1: input.Field1,
      name2: input.Field2,
      name3: input.Field3,
      name4: input.SomeCollection.SelectMany(...).Where(...).Select(...), // This field gets mixed up with...
      name5: input.AnotherCollection.Select(...), // This field...
      name6: out outA,
      name7: out outB,
      name8: out outC
   );
}
I know that code ain't pretty, but somefield.DoSomething was code that was generated from an Oracle package, so yeah.
That's also why it's named, so the parameters won't mix up when someone changes the package.


modified 1-Dec-16 14:08pm.

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 
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 

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.