Postal icon indicating copy to clipboard operation
Postal copied to clipboard

The namespace Postal conflicts with the class named Postal

Open klefevre opened this issue 9 years ago • 3 comments

If a user want to create a class/struct/enum that as the same name as a public data type in Postal. The compiler will conflict with Postal class name and the Postal module.

e.g.

// Target1:
struct Address {
}

let postalAddress: Postal.Address = ... // Don't compile - try to find a nested type of the class Postal
let targetAddress: Address = ... // Compile but Target.Address

It is a known bug and I thought swift3 would fix this issue but it didn't and it becomes really annoying to whoever want to have a class named Address, or MessageHeader (every public class in Postal) for a complete other purpose...

To fix this I would propose to rename the Postal class for PostalClient. @jeremiegirault WDYT ?

klefevre avatar Sep 28 '16 14:09 klefevre

Let's find an appropriate name together and change this indeed to avoid this compiler issue. Thanks for the hint.

jeremiegirault avatar Sep 28 '16 21:09 jeremiegirault

PostalClient seems the most legit. Maybe a simple Client would be ok because if a user has already a class named Client he'd call Postal.Client which is ok for me... Any preference between both ?

klefevre avatar Sep 29 '16 14:09 klefevre

hmmmmm PostalClient looks good to me. Let's do it

jeremiegirault avatar Sep 29 '16 14:09 jeremiegirault