Bug seting out parameter??
5 posts • Page 1 of 1
Bug seting out parameter??
Hello there, i´m struggling with the out parameter and what did I find out?
I dont know if it´s a bug or it´s the expected behavior, it looks like an error...
I have an OnMethodBoundaryAspect and in the OnEntry I change the value of the output parameter and set the FlowBehavior to Return. I was expecting to have that value back on my method... but it´s no there.
If I change the out parameter in OnSuccess or OnExit, it works. );
So, whats the deal with out parameter?
Tanks.
I dont know if it´s a bug or it´s the expected behavior, it looks like an error...
I have an OnMethodBoundaryAspect and in the OnEntry I change the value of the output parameter and set the FlowBehavior to Return. I was expecting to have that value back on my method... but it´s no there.
If I change the out parameter in OnSuccess or OnExit, it works. );
So, whats the deal with out parameter?
Tanks.
- vbandrade
- Posts: 6
- Joined: Wed Jul 02, 2008 6:39 am
- Full Name: vbandrade
Re: Bug seting out parameter??
What does Reflector say? Did you look at the generated code?
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 674
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
Re: Bug seting out parameter??
Hey there,
Reflector says:
private static int Print(int a, out int b)
{
// Cut stuff we dont need.
if (args.FlowBehavior == FlowBehavior.Return)
{
returnValue = (int) args.ReturnValue;
objArray[1] = (int) b;
return returnValue;
}
//back to method
PostSharp is ignoring whatever I do to the out parameter and overrides it with the default value. I dont think that should ever be done.
I'm using PostSharp 1.0.9.373
Thanks.
Edit: Attached my test.
Reflector says:
private static int Print(int a, out int b)
{
// Cut stuff we dont need.
if (args.FlowBehavior == FlowBehavior.Return)
{
returnValue = (int) args.ReturnValue;
objArray[1] = (int) b;
return returnValue;
}
//back to method
PostSharp is ignoring whatever I do to the out parameter and overrides it with the default value. I dont think that should ever be done.
I'm using PostSharp 1.0.9.373
Thanks.
Edit: Attached my test.
You do not have the required permissions to view the files attached to this post.
- vbandrade
- Posts: 6
- Joined: Wed Jul 02, 2008 6:39 am
- Full Name: vbandrade
Re: Bug seting out parameter??
It looks like a bug, because PostSharp does:
objArray[1] = (int) b;
but it should do:
b = (int) objArray[1]
Could you report it? Please include a link to the current discussion.
Thanks,
Gael
objArray[1] = (int) b;
but it should do:
b = (int) objArray[1]
Could you report it? Please include a link to the current discussion.
Thanks,
Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 674
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
Re: Bug seting out parameter??
It's there:
http://www.postsharp.org/tracker/view.php?id=234
i just started following this project and I'm wondering how long does it take to fix stuff like that. It looks like a simple fix to me.
Then I downloaded the code. Well, not THAT simple, but find my way through...
My guess is that you should solve this in the file OnMethodBoundaryAspectWeaver.cs
lines 349 and 350... but then again, I just got here.
Sorry for wasting your time, it's a awesome tool and since I don't have the money to contribute (specially from Brasil) I was looking for a way to contribute. I better start writing some beginner tutorials.
Congrats on your work
http://www.postsharp.org/tracker/view.php?id=234
i just started following this project and I'm wondering how long does it take to fix stuff like that. It looks like a simple fix to me.
Then I downloaded the code. Well, not THAT simple, but find my way through...
My guess is that you should solve this in the file OnMethodBoundaryAspectWeaver.cs
lines 349 and 350... but then again, I just got here.
Sorry for wasting your time, it's a awesome tool and since I don't have the money to contribute (specially from Brasil) I was looking for a way to contribute. I better start writing some beginner tutorials.
Congrats on your work
- vbandrade
- Posts: 6
- Joined: Wed Jul 02, 2008 6:39 am
- Full Name: vbandrade
5 posts • Page 1 of 1