snipsco / Postal

A Swift framework for working with emails
MIT License
653 stars 82 forks source link

The namespace Postal conflicts with the class named Postal #33

Open klefevre opened 8 years ago

klefevre commented 8 years ago

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 ?

jeremiegirault commented 8 years ago

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

klefevre commented 8 years ago

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 ?

jeremiegirault commented 8 years ago

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