Open destects opened 5 years ago
Sorry, I don't understand your issue clearly.
I've just created a unit test for the situation that you've described in the issue title but I cannot reproduce the problem. https://github.com/realvizu/NsDepCop/blob/e56565c905adaa8bd831d3e7eb64655db5bbce83/source/NsDepCop.Core.Test/Implementation/Analysis/TypeDependencyValidatorTests.cs#L123-L130
Also, the implementation of the TypeDependencyValidator explicitly starts with allowing all same-namespace references, so a.b.c->a.b.c
should not throw a warning.
https://github.com/realvizu/NsDepCop/blob/e56565c905adaa8bd831d3e7eb64655db5bbce83/source/NsDepCop.Core/Implementation/Analysis/TypeDependencyValidator.cs#L32-L36
So could you give me a complete example so I can reproduce your problem?
Oh, I think I understand now. So your problem is that a disallowed rule is stronger than the ChildCanDependOnParentImplicitly flag, is that right? As stated in this unit test: https://github.com/realvizu/NsDepCop/blob/83c34ce60855da2ada5e06ca91cf976731f59468/source/NsDepCop.Core.Test/Implementation/Analysis/TypeDependencyValidatorTests.cs#L133-L141
ChildCanDependOnParentImplicitly="true" and
Will cause any references between the Core.Something.SubSomething namespace (and it's children) to Core.Something.SubSomething.* namespaces to throw an illegal namespace warning.
And also, Core.Something.SubSomething.Things1 namespace should be able to reference Core.Something.SubSomething.Thing2 namespace without issue. but a lateral reference is not allowed. and since Disallowed is stronger than Allowed, the lateral movement is reported as an illegal reference.