Hacker News new | past | comments | ask | show | jobs | submit login

I can see how it could cause problems if they weren’t using the type system correctly.

    typedef float cm;
    typedef float meter:
    cm a = 1;
    meter b = 1;
    if (a == b) {
        // launch rockets
    }
I’ve done something similar (not including rockets, don’t worry!) in Swift with its typealias feature. Thankfully there is a way to actually force compiler errors in such situations with something like https://github.com/pointfreeco/swift-tagged



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: