[swift-dev] Typos while hacking on the constraint system

Robert Widmann rwidmann at apple.com
Thu Aug 17 12:03:36 CDT 2017

It’s an unfortunate naming scheme, but I would hesitate to use notions like “from” and “to”, especially in CSSimplify where different matchers are handed types in whatever order variance requires.  More critical here are the scoping issues.  There are a bunch of places, especially in matchTypes itself, where type1 and type2 are re-assigned in branches during the matching process.  It makes it more of a pain to debug than it should be.

~Robert Widmann

> On Aug 17, 2017, at 9:55 AM, David Zarzycki via swift-dev <swift-dev at swift.org> wrote:
> Hello,
> More than once, I’ve made typos while hacking on the constraint system because the key variables are often named “type1” and “type2”. Beyond sharing 4 out of 5 characters, the ‘1’ and the ‘2’ are right next to each other on the keyboard, and typing the other by accident results in code that still compiles.
> Are “type1” and “type2” really the most apt names? Is something preventing better names from being used? Wouldn’t “fromTy” and “toTy” be better and less typo prone?
> Thanks,
> Dave
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

More information about the swift-dev mailing list