I've been working on a prototype implementation for compound variable names on-and-off for the past few weeks, and I'm starting to think about what the best way to land this change would be. It's going to be a pretty significant change, since pretty much every part of the compiler has to be reworked to support
VarDecl::getName() returning a
DeclName instead of an
I wanted to solicit feedback from maintainers about what parts of this feature (if any) would be appropriate to land on
master before the proposal has actually gone through review.
For instance, much of the parsing logic could be merged in, which would allow the compiler to emit a more-helpful "variable declarations may not have compound names" diagnostic rather than the nonsense "consecutive declarations on a line must be separated by ';'" error that is emitted today. This seems potentially useful regardless of whether compound variable names eventually get added or not.
To take it further, though, much larger portions of the feature could be landed if compound variable names are something we definitely want to have in some form in the future. E.g., we could change
VarDecl::getName() to return a
DeclName without actually enabling compound variable names in order to front load the work of migrating all the portions of the compiler affected by that API difference.
In the extreme, of course, the entire feature could be merged behind an experimental flag. I'd appreciate guidance from anyone (especially those with with authority on this decision) about what seems appropriate so that I can better organize my development effort!