Hi there, 
        
The issue DYNPROXY-ISSUE-82 was just created by Fabio Maulo (fabiomaulo).
        
        Key: DYNPROXY-ISSUE-82
        Summary: Not allow generics & NoGeneric methods with same signature
        Type: Bug
        Importance: Medium
        
        Description:
        DynamicProxy2 version: 2.0.3.5561
Giving a service with two methods with same name and same parameter list but 
one generic and other no-generic the creation of the proxy is not allowed with 
the follow exception:
Castle.DynamicProxy.Generators.GeneratorException: Found more than one method 
on target ....
The test is:
        public interface IMyService
        {
                ISomething CreateSomething<T>(string somethingSpec);
                ISomething CreateSomething(string somethingKey);
        }
        public interface ISomething
        {
                void Do(Type type, string parameter);
        }
        public class NoOpSomething : ISomething
        {
                #region ISomething Members
                public void Do(Type type, string parameter) {}
                #endregion
        }
        public class MyServiceImpl : IMyService
        {
                #region IMyService Members
                public ISomething CreateSomething<T>(string somethingSpec)
                {
                        return new NoOpSomething();
                }
                public ISomething CreateSomething(string somethingKey)
                {
                        return new NoOpSomething();
                }
                #endregion
        }
        public class NoOpInterceptor : IInterceptor
        {
                #region IInterceptor Members
                public void Intercept(IInvocation invocation)
                {
                        invocation.Proceed();
                }
                #endregion
        }
        [TestFixture]
        public class NotAllowGenericsAndNoGenericMethodsWithSameSign
        {
                [Test]
                public void ShouldNotThrowException()
                {
                        var generator = new ProxyGenerator();
                        var target =
                                (IMyService)
                                generator.CreateInterfaceProxyWithTarget(typeof 
(IMyService), new MyServiceImpl(), new NoOpInterceptor());
                        Assert.IsNotNull(target.CreateSomething<int>("aa"));
                }
        }
        
For more, see 
http://support.castleproject.org/projects/DYNPROXY/issues/view/DYNPROXY-ISSUE-82
 
        
--
donjon
by Castle Stronghold
http://www.castle-donjon.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to