|
|
|
Community Member
|
|
I'm trying to use Torch.dbc and running into something odd.
if you have a method signature like public void TwoParam([NonNull]string arg1, [NonNull]string arg2)
the NonNull check only gets applied to the first parameter. poking around in the code, i saw this:
if (!methods.ContainsKey(paramDef.Parent)) { codeWeaver.AddMethodLevelAdvice(new NonNullParameterAdvice(paramDef), new Singleton<MethodDefDeclaration>(paramDef.Parent), JoinPointKinds.BeforeMethodBody, null); methods.Add(paramDef.Parent, paramDef.Parent); }
so, when the second attribute comes in, the method is already in the collection so the advice doesn't get applied.
Is there a reason this is here or should it be removed?
|
|
|
|
|
Gael Fraiteur
SharpCrafters
|
|
I made some corrections to this plug-in for compatibility with PostSharp 1.5 (you can apply NonNull on interfaces). it is available in the "1.5" folder.
-gael
|
|
|
|
|
Community Member
|
|
Gael,
i got the latest code from the googlecode svn and that methods.ContainsKey check is still there. is that code not up to date or is there a reason that NonNull can only be applied to one parameter of a method?
|
|
|
|
|
Gael Fraiteur
SharpCrafters
|
|
Michael,
I don't know. You should contact the original author. I actually don't support this project.
-gael
|
|
|
|
|
Community Member
|
|
Gotcha. i only saw your name on the code in SVN so i assumed you wrote it <!-- s:lol: --> <!-- s:lol: -->
i've posted an issue to the googlecode repository.
|
|
|
|