This is an author's peer-reviewed final manuscript, as accepted by the publisher. The published article is copyrighted by the Association for Computing Machinery and can be found at: http://toplas.acm.org/.Through the use of conditional compilation and related tools, many software projects can be used to generate a huge\ud number of related programs. The problem of typing such variational software is difficult. The brute-force strategy\ud of generating all variants and typing each one individually is (1) usually infeasible for efficiency reasons and (2)\ud produces results that do not map well to the underlying variational program. Recent research has focused mainly\ud on efficiency and addressed only the problem of type checking. In this w...